فهرست منبع

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

Amr Bashir 4 سال پیش
والد
کامیت
dd52e738f1
3فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 4 0
      .changes/api-ts-expect-error.md
  2. 0 0
      core/tauri/scripts/bundle.js
  3. 6 3
      tooling/api/src/window.ts

+ 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.
  */
 function getCurrent(): WebviewWindow {
-  // @ts-expect-error
   return new WebviewWindow(window.__TAURI__.__currentWindow.label, {
+    // @ts-expect-error
     skip: true
   })
 }
@@ -207,9 +207,12 @@ function getCurrent(): WebviewWindow {
  * @return The list of WebviewWindow.
  */
 function getAll(): WebviewWindow[] {
-  // @ts-expect-error
   return window.__TAURI__.__windows.map(
-    (w) => new WebviewWindow(w, { skip: true })
+    (w) =>
+      new WebviewWindow(w.label, {
+        // @ts-expect-error
+        skip: true
+      })
   )
 }
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است