Skip to content

Commit

Permalink
when removing address, remove it only for that chain id
Browse files Browse the repository at this point in the history
  • Loading branch information
KillariDev committed Nov 25, 2024
1 parent d02270e commit 1728f93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/ts/background/popupMessageHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export async function changeMakeMeRich(ethereumClientService: EthereumClientServ
}

export async function removeAddressBookEntry(simulator: Simulator, websiteTabConnections: WebsiteTabConnections, removeAddressBookEntry: RemoveAddressBookEntry) {
await updateUserAddressBookEntries((previousContacts) => previousContacts.filter((contact) => contact.address !== removeAddressBookEntry.data.address))
await updateUserAddressBookEntries((previousContacts) => previousContacts.filter((contact) =>
contact.address !== removeAddressBookEntry.data.address
&& (contact.chainId === removeAddressBookEntry.data.chainId || (contact.chainId === undefined && removeAddressBookEntry.data.chainId === 1n)))
)
if (removeAddressBookEntry.data.addressBookCategory === 'My Active Addresses') updateWebsiteApprovalAccesses(simulator, websiteTabConnections, await getSettings())
return await sendPopupMessageToOpenWindows({ method: 'popup_addressBookEntriesChanged' })
}
Expand Down

0 comments on commit 1728f93

Please sign in to comment.