From 5bc38ff09e0796b7fca9fdd1deccc816eded565c Mon Sep 17 00:00:00 2001 From: Fernando Date: Wed, 2 Jun 2021 10:55:13 -0300 Subject: [PATCH] [Address Book v2] - Avoid deleting addressBook entry when deleting a safe (#2374) * avoid deleting addressBook entry when deleting a safe * avoid deleting addressBook entry when deleting a safe --- src/routes/safe/components/Settings/RemoveSafeModal/index.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/routes/safe/components/Settings/RemoveSafeModal/index.tsx b/src/routes/safe/components/Settings/RemoveSafeModal/index.tsx index 651017ac..47b31d14 100644 --- a/src/routes/safe/components/Settings/RemoveSafeModal/index.tsx +++ b/src/routes/safe/components/Settings/RemoveSafeModal/index.tsx @@ -11,7 +11,6 @@ import Block from 'src/components/layout/Block' import Hairline from 'src/components/layout/Hairline' import Paragraph from 'src/components/layout/Paragraph' import Row from 'src/components/layout/Row' -import { addressBookRemove } from 'src/logic/addressBook/store/actions' import { addressBookMapSelector } from 'src/logic/addressBook/store/selectors' import { defaultSafeSelector, safeParamAddressFromStateSelector } from 'src/logic/safe/store/selectors' import { WELCOME_ADDRESS } from 'src/routes/routes' @@ -41,8 +40,7 @@ export const RemoveSafeModal = ({ isOpen, onClose }: RemoveSafeModalProps): Reac const onRemoveSafeHandler = async () => { // ToDo: review if this is necessary or we should directly use the `removeSafe` action. await dispatch(removeLocalSafe(safeAddress)) - // remove safe from the address book - safeAddressBookEntry && dispatch(addressBookRemove(safeAddressBookEntry)) + if (sameAddress(safeAddress, defaultSafe)) { await saveDefaultSafe('') }