-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathApp.vue
More file actions
27 lines (24 loc) · 737 Bytes
/
App.vue
File metadata and controls
27 lines (24 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<template>
<RouterView />
</template>
<script setup>
import { checkUpdate, installUpdate } from "@tauri-apps/api/updater";
import { relaunch } from "@tauri-apps/api/process";
import { appWindow } from "@tauri-apps/api/window";
import { invoke } from "@tauri-apps/api/tauri";
appWindow.listen("resume_downloading_all_pending", e => invoke("download_all_pending"));
appWindow.listen("check_app_update", async e => {
try {
const { shouldUpdate, manifest } = await checkUpdate();
if (shouldUpdate) {
// display dialog
await installUpdate();
// install complete, restart the app
await relaunch();
}
} catch (error) {
console.warn(error);
}
});
appWindow.emit("js_listeners_ready");
</script>