mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
Show wrench instantly on setting 3dmigoto
This commit is contained in:
@@ -97,7 +97,7 @@ pub fn install_location() -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[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);
|
let mut migoto_pathbuf = PathBuf::from(migoto_path);
|
||||||
|
|
||||||
migoto_pathbuf.pop();
|
migoto_pathbuf.pop();
|
||||||
@@ -114,6 +114,8 @@ pub fn set_migoto_target(migoto_path: String) -> bool {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
window.emit("migoto_set", &()).unwrap();
|
||||||
|
|
||||||
// Set options
|
// Set options
|
||||||
conf
|
conf
|
||||||
.with_section(Some("Loader"))
|
.with_section(Some("Loader"))
|
||||||
|
|||||||
@@ -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
|
// Emitted for automatic processes
|
||||||
listen('grasscutter_closed', async () => {
|
listen('grasscutter_closed', async () => {
|
||||||
const autoService = await getConfigOption('auto_mongodb')
|
const autoService = await getConfigOption('auto_mongodb')
|
||||||
|
|||||||
Reference in New Issue
Block a user