Skip to content

Commit

Permalink
Fixing the account name issue when adding it again (#3308)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyphenized authored Apr 26, 2023
2 parents af43463 + 0d34c70 commit f3e264f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions background/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ export default class Main extends BaseService<never> {
await this.providerBridgeService.revokePermissionsForAddress(address)
// TODO Adjust to handle specific network.
await this.signingService.removeAccount(address, signer.type)

this.nameService.removeAccount(address)
}

async importLedgerAccounts(
Expand Down
8 changes: 8 additions & 0 deletions background/services/name/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,14 @@ export default class NameService extends BaseService<Events> {
}
}

removeAccount(address: HexString): void {
const chainIds = Object.keys(this.cachedResolvedNames.EVM)

chainIds.forEach((chainId) => {
this.clearNameCacheEntry(chainId, address)
})
}

async lookUpAvatar(
addressOnNetwork: AddressOnNetwork
): Promise<ResolvedAvatarRecord | undefined> {
Expand Down

0 comments on commit f3e264f

Please sign in to comment.