From ac79af2d7a6c63a0607d9f9c9801461f35f22916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trung=20B=E1=BA=A1ch?= <66735837+trungbach@users.noreply.github.com> Date: Sun, 12 Jan 2025 17:46:54 +0700 Subject: [PATCH] Refactor updateAddedTokens to simplify token filtering logic (#1125) --- src/reducer/token.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/reducer/token.ts b/src/reducer/token.ts index d6b0a0b52..a5a79eb00 100644 --- a/src/reducer/token.ts +++ b/src/reducer/token.ts @@ -112,10 +112,7 @@ export const tokenSlice = createSlice({ updateAddedTokens: (state, action: PayloadAction) => { state.addedTokens = [ ...state.addedTokens, - ...action.payload.filter( - (token: TokenItemType) => - !state.addedTokens.find((t) => t?.denom === token?.denom || t?.contractAddress === token?.contractAddress) - ) + ...action.payload.filter((token: TokenItemType) => !state.addedTokens.find((t) => t?.denom === token?.denom)) ]; } }