fix(notification/windows): Grant permission without invoking backend (#1556)

* fix(notification/windows): Grant permission without invoking backend

* fmt
This commit is contained in:
Fabian-Lars
2024-07-23 13:10:58 +02:00
committed by GitHub
parent 117c67da13
commit 725ff4295e
4 changed files with 12 additions and 3 deletions
+2 -1
View File
@@ -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",
);