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:
@@ -44,7 +44,7 @@ export default function SettingsPage() {
|
||||
|
||||
const [thresholds, setThresholdsState] = useState(getThresholds);
|
||||
const [notifPermission, setNotifPermission] = useState<boolean>(
|
||||
typeof window !== "undefined" && Notification.permission === "granted"
|
||||
typeof window !== "undefined" && "Notification" in window && Notification.permission === "granted"
|
||||
);
|
||||
|
||||
const [pushoverKey, setPushoverKey] = useState("");
|
||||
|
||||
Reference in New Issue
Block a user