Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
3d820d39
Unverified
Commit
3d820d39
authored
Nov 21, 2022
by
Zach Pomerantz
Committed by
GitHub
Nov 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: include user-added tokens if selected (#5367)
parent
4fdca48a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
CurrencySearch.tsx
src/components/SearchModal/CurrencySearch.tsx
+3
-2
No files found.
src/components/SearchModal/CurrencySearch.tsx
View file @
3d820d39
...
@@ -92,15 +92,16 @@ export function CurrencySearch({
...
@@ -92,15 +92,16 @@ export function CurrencySearch({
!
balancesAreLoading
!
balancesAreLoading
?
filteredTokens
?
filteredTokens
.
filter
((
token
)
=>
{
.
filter
((
token
)
=>
{
// If there is no query, filter out user-added tokens with no balance.
// If there is no query, filter out u
nselected u
ser-added tokens with no balance.
if
(
!
debouncedQuery
&&
token
instanceof
UserAddedToken
)
{
if
(
!
debouncedQuery
&&
token
instanceof
UserAddedToken
)
{
if
(
selectedCurrency
?.
equals
(
token
)
||
otherSelectedCurrency
?.
equals
(
token
))
return
true
return
balances
[
token
.
address
]?.
greaterThan
(
0
)
return
balances
[
token
.
address
]?.
greaterThan
(
0
)
}
}
return
true
return
true
})
})
.
sort
(
tokenComparator
.
bind
(
null
,
balances
))
.
sort
(
tokenComparator
.
bind
(
null
,
balances
))
:
[],
:
[],
[
balances
,
balancesAreLoading
,
debouncedQuery
,
filteredTokens
]
[
balances
,
balancesAreLoading
,
debouncedQuery
,
filteredTokens
,
otherSelectedCurrency
,
selectedCurrency
]
)
)
const
isLoading
=
Boolean
(
balancesAreLoading
&&
!
tokenLoaderTimerElapsed
)
const
isLoading
=
Boolean
(
balancesAreLoading
&&
!
tokenLoaderTimerElapsed
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment