From b9853595f665834503e31bcaa88caf316b5855d0 Mon Sep 17 00:00:00 2001 From: MrSirDev Date: Thu, 17 Feb 2022 16:31:04 -0800 Subject: [PATCH] added throw error if no account is chosen --- src/stores.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/stores.js b/src/stores.js index fd7318e..4b04707 100644 --- a/src/stores.js +++ b/src/stores.js @@ -100,7 +100,10 @@ export const createStore = () => { try { accounts = await eipProvider.request({ method: 'eth_requestAccounts' }) } catch (e) { - console.warn('[svelte-web3] non compliant 1193 provider') + // if there are no accounts to store throw error + if (eipProvider?.accounts) { + throw new Error('[svelte-web3] non compliant 1193 provider') + } // some provider may store accounts directly like walletconnect accounts = eipProvider.accounts }