mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
♻️ 启动后只执行一次
This commit is contained in:
18
src/App.vue
18
src/App.vue
@@ -37,12 +37,9 @@ onBeforeMount(async () => {
|
||||
isMain.value = win.label === "TeyvatGuide";
|
||||
if (isMain.value) {
|
||||
const title = "Teyvat Guide v" + (await app.getVersion()) + " Beta";
|
||||
await tauri.invoke("register_deep_link");
|
||||
await getDeepLink();
|
||||
await win.setTitle(title);
|
||||
await emojiLoad();
|
||||
await checkAppLoad();
|
||||
await checkUserLoad();
|
||||
await listenOnInit();
|
||||
await tauri.invoke("init_app");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -63,6 +60,17 @@ async function listenOnTheme(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
// 启动后只执行一次的监听
|
||||
async function listenOnInit(): Promise<void> {
|
||||
await event.listen("initApp", async () => {
|
||||
await tauri.invoke("register_deep_link");
|
||||
await getDeepLink();
|
||||
await emojiLoad();
|
||||
await checkAppLoad();
|
||||
await checkUserLoad();
|
||||
});
|
||||
}
|
||||
|
||||
async function emojiLoad(): Promise<void> {
|
||||
const res = await getEmojis();
|
||||
if ("retcode" in res) {
|
||||
|
||||
Reference in New Issue
Block a user