Skip to content

Commit

Permalink
Fix: forget account for legacy account without authorizedAccounts (#1381
Browse files Browse the repository at this point in the history
)

* fix: forget account for legacy account without authorizedAccounts

* fix: comment
  • Loading branch information
Tbaut authored Jun 28, 2024
1 parent 4bf6f9f commit 0a52b5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/extension-base/src/background/handlers/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export default class Extension {

// cycle through authUrls and prepare the array of diff
Object.entries(this.#state.authUrls).forEach(([url, urlInfo]) => {
if (!urlInfo.authorizedAccounts.includes(address)) {
return;
// Note that urlInfo.authorizedAccounts may be undefined if this website entry
// was created before the "account authorization per website" functionality was introduced
if (urlInfo.authorizedAccounts?.includes(address)) {
authorizedAccountsDiff.push([url, urlInfo.authorizedAccounts.filter((previousAddress) => previousAddress !== address)]);
}

authorizedAccountsDiff.push([url, urlInfo.authorizedAccounts.filter((previousAddress) => previousAddress !== address)]);
});

this.#state.updateAuthorizedAccounts(authorizedAccountsDiff);
Expand Down

0 comments on commit 0a52b5d

Please sign in to comment.