Skip to content

Commit

Permalink
update provider
Browse files Browse the repository at this point in the history
  • Loading branch information
seaona committed Feb 4, 2024
1 parent 7e739da commit 7352fe8
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ async function handleWalletConnectChange({ isConnected }) {
handleNewProviderDetail(providerDetail);

isWalletConnectConnected = true;
updateFormElements();
try {
const newAccounts = await provider.request({
method: 'eth_accounts',
Expand Down Expand Up @@ -492,6 +493,7 @@ const setActiveProviderDetail = async (providerDetail) => {
activeProviderIconResult.innerHTML = icon
? `<img src="${icon}" height="90" width="90" />`
: '';
updateFormElements();
};

const setActiveProviderDetailWindowEthereum = () => {
Expand Down Expand Up @@ -821,18 +823,20 @@ const updateFormElements = () => {
button.disabled = true;
}
clearDisplayElements();
} else {
}
if (
isWalletConnectConnected &&
activeProviderNameResult.innerText === 'wallet-connect'
) {
for (const button of walletConnectButtons) {
button.disabled = false;
}
} else if (isMetaMaskConnected()) {
for (const button of initialConnectedButtons) {
button.disabled = false;
}
}

for (const button of walletConnectButtons) {
isWalletConnectConnected
? (button.disabled = false)
: (button.disabled = true);
}

updateOnboardElements();
updateContractElements();
};
Expand Down

0 comments on commit 7352fe8

Please sign in to comment.