Skip to content

Commit

Permalink
Disconnect before changing address
Browse files Browse the repository at this point in the history
  • Loading branch information
Montoya committed Apr 17, 2024
1 parent e39c030 commit acf1e53
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/site/src/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ const snapInstalled = async (provider, skippedStep1 = false) => {

btn.onclick = async (event) => {
event.preventDefault();
if (isAccountConnected) {
// need to disconnect first
await window.ethereum.request({
"method": "wallet_revokePermissions",
"params": [
{
"eth_accounts": {}
}
]
});
isAccountConnected = false;
}
const accounts = await provider.request({
method: 'eth_requestAccounts',
params: [],
Expand Down

0 comments on commit acf1e53

Please sign in to comment.