🐛 解决最小化无法唤起问题

This commit is contained in:
BTMuli
2023-10-12 00:15:12 +08:00
parent 3b0bc4b1a5
commit f6bea9b2e7

View File

@@ -167,10 +167,12 @@ async function initData(): Promise<void> {
} }
async function getDeepLink(): Promise<void> { async function getDeepLink(): Promise<void> {
await event.listen("active_deep_link", (e) => { await event.listen("active_deep_link", async (e) => {
new TauriWindow.WebviewWindow("TeyvatGuide") const windowGet = new TauriWindow.WebviewWindow("TeyvatGuide");
.setFocus() if (await windowGet.isMinimized()) {
.then(async () => { await windowGet.unminimize();
}
await windowGet.setFocus();
if (typeof e.payload !== "string") { if (typeof e.payload !== "string") {
showSnackbar({ showSnackbar({
text: "无效的 deep link", text: "无效的 deep link",
@@ -200,10 +202,6 @@ async function getDeepLink(): Promise<void> {
timeout: 3000, timeout: 3000,
}); });
} }
})
.catch((e) => {
console.log(e);
});
}); });
} }
</script> </script>