This commit is contained in:
zadit
2024-10-22 16:05:30 +07:00
parent e2522bd91c
commit 1ecc6db645
17 changed files with 320 additions and 137 deletions

View File

@@ -0,0 +1,14 @@
// notificationService.js
export const requestNotificationPermission = async () => {
let permission = Notification.permission;
// Check current permission
if (permission === "default") {
const result = await Notification.requestPermission();
permission = result; // Update permission status
}
// Return permission status
return permission;
};