diff --git a/app/ts/background/popupMessageHandlers.ts b/app/ts/background/popupMessageHandlers.ts index 522bd007..8cfc67e8 100644 --- a/app/ts/background/popupMessageHandlers.ts +++ b/app/ts/background/popupMessageHandlers.ts @@ -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' }) }