mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +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") {
|
if (window.Notification.permission !== "default") {
|
||||||
return Promise.resolve(window.Notification.permission === "granted");
|
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) {
|
function setNotificationPermission(value) {
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
Object.freeze(options);
|
Object.freeze(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.__TAURI__.invoke("plugin:notification|notify", {
|
return window.__TAURI_INVOKE__("plugin:notification|notify", {
|
||||||
options:
|
options:
|
||||||
typeof options === "string"
|
typeof options === "string"
|
||||||
? {
|
? {
|
||||||
|
|||||||
Reference in New Issue
Block a user