From a70a38f481dd3b41b458e8517b0e9fc3c9625554 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 25 Mar 2021 10:03:44 +0100 Subject: [PATCH] focus can throw on Android, wrap it in a try/catch --- src/platform/web/service-worker.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/web/service-worker.js b/src/platform/web/service-worker.js index b01ad5ff..3a68d125 100644 --- a/src/platform/web/service-worker.js +++ b/src/platform/web/service-worker.js @@ -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");