diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index 5eb249e..bed704e 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -97,7 +97,7 @@ pub fn install_location() -> String { } #[tauri::command] -pub fn set_migoto_target(migoto_path: String) -> bool { +pub fn set_migoto_target(window: tauri::Window, migoto_path: String) -> bool { let mut migoto_pathbuf = PathBuf::from(migoto_path); migoto_pathbuf.pop(); @@ -114,6 +114,8 @@ pub fn set_migoto_target(migoto_path: String) -> bool { } }; + window.emit("migoto_set", &()).unwrap(); + // Set options conf .with_section(Some("Loader")) diff --git a/src/ui/Main.tsx b/src/ui/Main.tsx index 37c50ce..61deed1 100644 --- a/src/ui/Main.tsx +++ b/src/ui/Main.tsx @@ -78,6 +78,14 @@ export class Main extends React.Component { } }) + listen('migoto_set', async () => { + this.setState({ + migotoSet: !!(await getConfigOption('migoto_path')), + }) + + window.location.reload() + }) + // Emitted for automatic processes listen('grasscutter_closed', async () => { const autoService = await getConfigOption('auto_mongodb')