mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-28 21:51:47 +02:00
fix(notification/windows): Grant permission without invoking backend (#1556)
* fix(notification/windows): Grant permission without invoking backend * fmt
This commit is contained in:
@@ -10,7 +10,8 @@ import type { Options } from "./index";
|
||||
let permissionValue = "default";
|
||||
|
||||
async function isPermissionGranted(): Promise<boolean> {
|
||||
if (window.Notification.permission !== "default") {
|
||||
// @ts-expect-error __TEMPLATE_windows__ will be replaced in rust before it's injected.
|
||||
if (window.Notification.permission !== "default" || __TEMPLATE_windows__) {
|
||||
return await Promise.resolve(
|
||||
window.Notification.permission === "granted",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user