Show wrench instantly on setting 3dmigoto

This commit is contained in:
Thoronium
2023-04-05 21:26:47 -06:00
parent 33ddc36741
commit 77380e357c
2 changed files with 11 additions and 1 deletions

View File

@@ -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"))

View File

@@ -78,6 +78,14 @@ export class Main extends React.Component<IProps, IState> {
}
})
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')