fix(settings): guard Notification API for iOS Safari

Notification is undefined on iOS Safari — bare access crashes on render.
Added "Notification" in window check before accessing .permission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 15:47:34 +02:00
parent eb1e5ee3fe
commit 78fc31252e
+1 -1
View File
@@ -44,7 +44,7 @@ export default function SettingsPage() {
const [thresholds, setThresholdsState] = useState(getThresholds); const [thresholds, setThresholdsState] = useState(getThresholds);
const [notifPermission, setNotifPermission] = useState<boolean>( const [notifPermission, setNotifPermission] = useState<boolean>(
typeof window !== "undefined" && Notification.permission === "granted" typeof window !== "undefined" && "Notification" in window && Notification.permission === "granted"
); );
const [pushoverKey, setPushoverKey] = useState(""); const [pushoverKey, setPushoverKey] = useState("");