1
0
Fork 0
forked from Mirrors/gomuks

web/main: add ios safari compatibility

This commit is contained in:
Tulir Asokan 2024-12-05 19:29:12 +02:00
parent 2e5c2fdd6c
commit 714aa477b7
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ export default class Client {
}
console.log("Successfully authenticated, connecting to websocket")
this.rpc.start()
Notification.requestPermission()
window.Notification?.requestPermission()
.then(permission => console.log("Notification permission:", permission))
}

View file

@ -180,7 +180,7 @@ export class StateStore {
}
}
if (Notification.permission === "granted" && !focused.current) {
if (window.Notification?.permission === "granted" && !focused.current) {
for (const notification of data.notifications) {
this.showNotification(room, notification.event_rowid, notification.sound)
}