Skip to content

Commit

Permalink
fix(api.js): fix @ts-expect-error usage, closes #2249 (#2250)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Jul 19, 2021
1 parent e3f9916 commit dd52e73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .changes/api-ts-expect-error.md
@@ -0,0 +1,4 @@
---
"api": patch
---
Fix `@ts-expect` error usage
2 changes: 1 addition & 1 deletion core/tauri/scripts/bundle.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions tooling/api/src/window.ts
Expand Up @@ -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
})
}
Expand All @@ -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
})
)
}

Expand Down

0 comments on commit dd52e73

Please sign in to comment.