Fix: forget account for legacy account without authorizedAccounts (#1381)
* fix: forget account for legacy account without authorizedAccounts * fix: comment
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user