Skip to content

Commit

Permalink
fix dont favorite when remove import token
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh committed Aug 9, 2023
1 parent 5f1cb76 commit dcd4993
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/SearchModal/CurrencySearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,13 @@ export function CurrencySearch({
const removeImportedToken = useCallback(
(token: Token) => {
removeToken(chainId, token.address)

toggleFavoriteToken({
chainId,
address: token.address,
})
if (favoriteTokens?.some(el => el.toLowerCase() === token.address.toLowerCase()))
toggleFavoriteToken({
chainId,
address: token.address,
})
},
[chainId, toggleFavoriteToken, removeToken],
[chainId, toggleFavoriteToken, removeToken, favoriteTokens],
)

const removeAllImportToken = () => {
Expand Down

0 comments on commit dcd4993

Please sign in to comment.