mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-07 15:50:29 +03:00
Prevent firefox from crashing because of no badging API
This commit is contained in:
parent
815a0ac7f4
commit
f24c6cce76
3 changed files with 16 additions and 3 deletions
|
|
@ -48,7 +48,11 @@ export const useRoomEventReaders = (room: Room, eventId?: string): string[] => {
|
|||
room.on(RoomEvent.Receipt, handleReceipt);
|
||||
room.on(RoomEvent.LocalEchoUpdated, handleLocalEcho);
|
||||
|
||||
navigator.setAppBadge(unreadInfo.total);
|
||||
try {
|
||||
navigator.setAppBadge(unreadInfo.total);
|
||||
} catch (e) {
|
||||
// Likely Firefox/Gecko-based and doesn't support badging API
|
||||
}
|
||||
return () => {
|
||||
room.removeListener(RoomEvent.Receipt, handleReceipt);
|
||||
room.removeListener(RoomEvent.LocalEchoUpdated, handleLocalEcho);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue