mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
fix(notification): Fix init.js script for use without global tauri object. (#414)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"notification": patch
|
||||
---
|
||||
|
||||
Use `window.__TAURI_INVOKE__` instead of `window.__TAURI__` in init.js, fixes usage in apps without `withGlobalTauri` enabled.
|
||||
@@ -10,7 +10,7 @@
|
||||
if (window.Notification.permission !== "default") {
|
||||
return Promise.resolve(window.Notification.permission === "granted");
|
||||
}
|
||||
return window.__TAURI__.invoke("plugin:notification|is_permission_granted");
|
||||
return window.__TAURI_INVOKE__("plugin:notification|is_permission_granted");
|
||||
}
|
||||
|
||||
function setNotificationPermission(value) {
|
||||
@@ -34,7 +34,7 @@
|
||||
Object.freeze(options);
|
||||
}
|
||||
|
||||
return window.__TAURI__.invoke("plugin:notification|notify", {
|
||||
return window.__TAURI_INVOKE__("plugin:notification|notify", {
|
||||
options:
|
||||
typeof options === "string"
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user