Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahendar0701 committed Nov 7, 2024
1 parent 54588b2 commit 115d9b1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,12 @@ export default function NotificationsList({
} catch (error) {
const permission = Notification.permission;

if (permission === "denied") {
if (permission === "denied" || permission === "default") {
Warn({
msg: t("notification_permission_denied"),
});
setIsSubscribing(false);
return;
} else if (permission === "default") {
Warn({
msg: t("notification_cancelled"),
});
setIsSubscribing(false);
return;
}
Error({
msg: t("subscription_failed"),
Expand Down

0 comments on commit 115d9b1

Please sign in to comment.