From 2d13ef1e83cfd53f0706dc58084ed412f2dcbd27 Mon Sep 17 00:00:00 2001 From: trungbach Date: Sun, 12 Jan 2025 17:22:50 +0700 Subject: [PATCH] Refactor updateAddedTokens to simplify token filtering logic --- 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)) ]; } }