fixed issue#5674 - for injected providers, it was looking for a selected account by default. if there's no selected account(-null), toChecksumAddress() was throwing an error, causing the dispatcher to propagate the error. My fix sets the first account as default selected account - once the user explicitly sets an account, it behaves as usual

pull/5710/head
Ritvik Puranik 1 week ago
parent 2b9a1e3fe2
commit 00c7e780a0
  1. 2
      libs/remix-ui/run-tab/src/lib/actions/account.ts

@ -31,7 +31,7 @@ export const fillAccountsList = async (plugin: RunTab, dispatch: React.Dispatch<
const provider = plugin.blockchain.getProvider()
if (provider && provider.startsWith('injected')) {
const selectedAddress = plugin.blockchain.getInjectedWeb3Address()
const selectedAddress = plugin.blockchain.getInjectedWeb3Address() || Object.keys(loadedAccounts)[0]; //Setting default account to first account
if (!(Object.keys(loadedAccounts).includes(toChecksumAddress(selectedAddress)))) setAccount(dispatch, null)
}
dispatch(fetchAccountsListSuccess(loadedAccounts))

Loading…
Cancel
Save