From 53852a95c14064f8452629e23771b507c4c6f4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Mon, 25 Sep 2023 17:36:24 +0200 Subject: [PATCH] Ignore some error --- site/source/components/ServiceWorker.tsx | 3 +++ site/source/components/ShareSimulationBanner/index.tsx | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/site/source/components/ServiceWorker.tsx b/site/source/components/ServiceWorker.tsx index de67a5afb..0fc611bde 100644 --- a/site/source/components/ServiceWorker.tsx +++ b/site/source/components/ServiceWorker.tsx @@ -83,6 +83,9 @@ export const ServiceWorker = () => { }, onRegisterError: (error) => { + if (error instanceof Error && /permission|aborted/i.test(error.message)) { + return + } // eslint-disable-next-line no-console console.error('SW registration error', error) }, diff --git a/site/source/components/ShareSimulationBanner/index.tsx b/site/source/components/ShareSimulationBanner/index.tsx index be0948218..94610b689 100644 --- a/site/source/components/ShareSimulationBanner/index.tsx +++ b/site/source/components/ShareSimulationBanner/index.tsx @@ -68,7 +68,10 @@ export default function ShareOrSaveSimulationBanner({ url, }) } catch (e) { - if (e instanceof Error && e.toString().includes('AbortError')) { + if ( + e instanceof Error && + (e.toString().includes('AbortError') || /permission/i.test(e.message)) + ) { return } // eslint-disable-next-line no-console