浏览代码

chore: apply temporary change to `__currentWindow` usage

Lucas Nogueira 3 年之前
父节点
当前提交
2792531347
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 0 0
      core/tauri/scripts/bundle.js
  2. 5 1
      tooling/api/src/window.ts

文件差异内容过多而无法显示
+ 0 - 0
core/tauri/scripts/bundle.js


+ 5 - 1
tooling/api/src/window.ts

@@ -231,7 +231,11 @@ class WebviewWindowHandle {
   listeners: { [key: string]: Array<EventCallback<any>> }
   listeners: { [key: string]: Array<EventCallback<any>> }
 
 
   constructor(label: WindowLabel | null | undefined) {
   constructor(label: WindowLabel | null | undefined) {
-    this.label = label ?? window.__TAURI__.__currentWindow.label
+    try {
+      this.label = label ?? window.__TAURI__.__currentWindow.label
+    } catch {
+      this.label = ''
+    }
     // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
     // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
     this.listeners = Object.create(null)
     this.listeners = Object.create(null)
   }
   }

部分文件因为文件数量过多而无法显示