From 7c3b9f46d8a2b54397e94ddb7ec7bff7578f5208 Mon Sep 17 00:00:00 2001 From: Alexander Evchenko Date: Thu, 31 Aug 2023 16:34:14 +0400 Subject: [PATCH] fix: RNS Manager being added to recentContacts --- src/redux/slices/contactsSlice/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/redux/slices/contactsSlice/index.ts b/src/redux/slices/contactsSlice/index.ts index 9bb31215b..38486e9b2 100644 --- a/src/redux/slices/contactsSlice/index.ts +++ b/src/redux/slices/contactsSlice/index.ts @@ -7,6 +7,7 @@ import { import { getContacts, saveContacts } from 'storage/MainStorage' import { Contact } from 'shared/types' import { defaultContacts } from 'store/slices/contactsSlice/constants' +import addresses from 'screens/rnsManager/addresses.json' const initialState: ContactsState = { contacts: defaultContacts, @@ -50,8 +51,15 @@ const contactsSlice = createSlice({ return state }, addRecentContact: (state, { payload }: PayloadAction) => { + if ( + addresses.fifsAddrRegistrarAddress.toLowerCase() === + payload.toLowerCase() + ) { + return + } + const addressForSearch = payload.toLowerCase() - console.log('addRecentContact', addressForSearch) + if (!state.recentContacts) { state.recentContacts = [] }