From e84ec4162c2248a2bcaee7612a75f4341bf1cf49 Mon Sep 17 00:00:00 2001 From: Jaco Date: Tue, 17 May 2022 08:43:29 +0200 Subject: [PATCH] Handle possible promise rejection cracefully (#1066) --- packages/extension-dapp/src/bundle.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/extension-dapp/src/bundle.ts b/packages/extension-dapp/src/bundle.ts index f0f81f28..72c132cf 100644 --- a/packages/extension-dapp/src/bundle.ts +++ b/packages/extension-dapp/src/bundle.ts @@ -165,8 +165,11 @@ export async function web3AccountsSubscribe (cb: (accounts: InjectedAccountWithM subscribe((result): void => { accounts[source] = result; - // eslint-disable-next-line @typescript-eslint/no-floating-promises - triggerUpdate(); + try { + triggerUpdate()?.catch(console.error); + } catch (error) { + console.error(error); + } }) );