Ver Fonte

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

Amr Bashir há 4 anos atrás
pai
commit
9fbcc02454

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

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

Diff do ficheiro suprimidas por serem muito extensas
+ 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 {

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff