Skip to content

Commit

Permalink
fix(api): global bundle broken code, closes #2289 (#2297)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jul 26, 2021
1 parent 8216cba commit 268450b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-global-tauri.md
@@ -0,0 +1,5 @@
---
"api": patch
---

Fixes the global bundle UMD code.
2 changes: 1 addition & 1 deletion core/tauri/scripts/bundle.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tooling/api/src/window.ts
Expand Up @@ -225,11 +225,11 @@ const localTauriEvents = ['tauri://created', 'tauri://error']
*/
class WebviewWindowHandle {
/** Window label. */
label: string
label: string | null
/** Local event listeners. */
listeners: { [key: string]: Array<EventCallback<any>> }

constructor(label: string) {
constructor(label: string | null) {
this.label = label
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
this.listeners = Object.create(null)
Expand Down Expand Up @@ -1071,7 +1071,7 @@ class WindowManager extends WebviewWindowHandle {
* ```
*/
class WebviewWindow extends WindowManager {
constructor(label: string, options: WindowOptions = {}) {
constructor(label: string | null, options: WindowOptions = {}) {
super(label)
// @ts-expect-error
if (!options?.skip) {
Expand Down Expand Up @@ -1108,7 +1108,7 @@ class WebviewWindow extends WindowManager {
}

/** The WebviewWindow for the current window. */
const appWindow = new WebviewWindow(window.__TAURI__.__currentWindow.label, {
const appWindow = new WebviewWindow(null, {
// @ts-expect-error
skip: true
})
Expand Down

0 comments on commit 268450b

Please sign in to comment.