Эх сурвалжийг харах

fix(api.js): fix `@ts-expect-error` usage, closes #2249 (#2250)

Amr Bashir 4 жил өмнө
parent
commit
dd52e738f1

+ 4 - 0
.changes/api-ts-expect-error.md

@@ -0,0 +1,4 @@
+---
+"api": patch
+---
+Fix `@ts-expect` error usage

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
core/tauri/scripts/bundle.js


+ 6 - 3
tooling/api/src/window.ts

@@ -195,8 +195,8 @@ enum UserAttentionType {
  * @return The current WebviewWindow.
  * @return The current WebviewWindow.
  */
  */
 function getCurrent(): WebviewWindow {
 function getCurrent(): WebviewWindow {
-  // @ts-expect-error
   return new WebviewWindow(window.__TAURI__.__currentWindow.label, {
   return new WebviewWindow(window.__TAURI__.__currentWindow.label, {
+    // @ts-expect-error
     skip: true
     skip: true
   })
   })
 }
 }
@@ -207,9 +207,12 @@ function getCurrent(): WebviewWindow {
  * @return The list of WebviewWindow.
  * @return The list of WebviewWindow.
  */
  */
 function getAll(): WebviewWindow[] {
 function getAll(): WebviewWindow[] {
-  // @ts-expect-error
   return window.__TAURI__.__windows.map(
   return window.__TAURI__.__windows.map(
-    (w) => new WebviewWindow(w, { skip: true })
+    (w) =>
+      new WebviewWindow(w.label, {
+        // @ts-expect-error
+        skip: true
+      })
   )
   )
 }
 }
 
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно