focus can throw on Android, wrap it in a try/catch

This commit is contained in:
Bruno Windels 2021-03-25 10:03:44 +01:00
parent bc763e2a19
commit a70a38f481

View file

@ -204,7 +204,9 @@ async function openClientFromNotif(event) {
console.log("notificationclick: client has session open, showing room there");
clientWithSession.navigate(roomURL);
if ('focus' in clientWithSession) {
await clientWithSession.focus();
try {
await clientWithSession.focus();
} catch (err) { console.error(err); } // I've had this throw on me on Android
}
} else if (self.clients.openWindow) {
console.log("notificationclick: no client found with session open, opening new window");