Handle possible promise rejection cracefully (#1066)

This commit is contained in:
Jaco 2022-05-17 08:43:29 +02:00 committed by GitHub
parent 56d1fb5f93
commit e84ec4162c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
})
);