Просмотр исходного кода

fix(api.js): fix double window creation, closes #2284 (#2285)

Amr Bashir 4 лет назад
Родитель
Сommit
9fbcc02454
3 измененных файлов с 9 добавлено и 2 удалено
  1. 5 0
      .changes/api-fix-double-window.md
  2. 0 0
      core/tauri/scripts/bundle.js
  3. 4 2
      tooling/api/src/window.ts

+ 5 - 0
.changes/api-fix-double-window.md

@@ -0,0 +1,5 @@
+---
+"api": patch
+---
+
+Fix double window creation

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
core/tauri/scripts/bundle.js


+ 4 - 2
tooling/api/src/window.ts

@@ -1108,8 +1108,10 @@ class WebviewWindow extends WindowManager {
 }
 
 /** The WebviewWindow for the current window. */
-// @ts-expect-error
-const appWindow = new WebviewWindow()
+const appWindow = new WebviewWindow(window.__TAURI__.__currentWindow.label, {
+  // @ts-expect-error
+  skip: true
+})
 
 /** Configuration for the window to create. */
 interface WindowOptions {

Некоторые файлы не были показаны из-за большого количества измененных файлов