fix: guard Notification API for unsupported browsers

Check typeof Notification before accessing .permission or
requestPermission(). Fixes crash on browsers/contexts where
the Notification API is unavailable (e.g. some WebViews).
This commit is contained in:
Nicolas Varrot
2026-02-12 07:58:23 +00:00
parent 5c69ef193a
commit 8301cba339
5 changed files with 106 additions and 12 deletions

View File

@@ -28,6 +28,8 @@ const en = {
'header.logout': 'Logout',
'header.toggleSidebar': 'Toggle sidebar',
'header.changeLanguage': 'Change language',
'header.soundOn': 'Enable notification sound',
'header.soundOff': 'Disable notification sound',
// Chat
'chat.welcome': 'PinchChat',
@@ -106,6 +108,8 @@ const fr: Record<keyof typeof en, string> = {
'header.logout': 'Déconnexion',
'header.toggleSidebar': 'Afficher/masquer la barre latérale',
'header.changeLanguage': 'Changer de langue',
'header.soundOn': 'Activer le son de notification',
'header.soundOff': 'Désactiver le son de notification',
'chat.welcome': 'PinchChat',
'chat.welcomeSub': 'Envoyez un message pour commencer',