mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-08-13 16:55:57 -04:00
fix(gui): Relaunch application after updater installation has finished (#137)
This commit is contained in:
parent
12528a9d4e
commit
8283d09b5b
2 changed files with 7 additions and 6 deletions
|
@ -87,11 +87,11 @@ export default function UpdaterDialog() {
|
||||||
...prev,
|
...prev,
|
||||||
downloadedBytes: prev.downloadedBytes + event.data.chunkLength,
|
downloadedBytes: prev.downloadedBytes + event.data.chunkLength,
|
||||||
}));
|
}));
|
||||||
} else if (event.event === 'Finished') {
|
|
||||||
// Relaunch the application for the new version to be used
|
|
||||||
relaunch();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Once the promise resolves, relaunch the application for the new version to be used
|
||||||
|
relaunch();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
enqueueSnackbar(`Failed to install update: ${err}`, {
|
enqueueSnackbar(`Failed to install update: ${err}`, {
|
||||||
variant: "error"
|
variant: "error"
|
||||||
|
|
|
@ -131,7 +131,8 @@ pub fn run() {
|
||||||
#[cfg(desktop)]
|
#[cfg(desktop)]
|
||||||
{
|
{
|
||||||
builder = builder.plugin(tauri_plugin_single_instance::init(|app, _, _| {
|
builder = builder.plugin(tauri_plugin_single_instance::init(|app, _, _| {
|
||||||
let _ = app.get_webview_window("main")
|
let _ = app
|
||||||
|
.get_webview_window("main")
|
||||||
.expect("no main window")
|
.expect("no main window")
|
||||||
.set_focus();
|
.set_focus();
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue