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
ceed5e0b
Unverified
Commit
ceed5e0b
authored
Nov 22, 2022
by
cartcrom
Committed by
GitHub
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: always return arrays from typed queries (#5382)
added empty array fallbacks
parent
a4493382
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
SearchTokensFetcher.ts
src/nft/queries/genie/SearchTokensFetcher.ts
+3
-4
TrendingCollectionsFetcher.ts
src/nft/queries/genie/TrendingCollectionsFetcher.ts
+1
-1
TrendingTokensFetcher.ts
src/nft/queries/genie/TrendingTokensFetcher.ts
+1
-1
No files found.
src/nft/queries/genie/SearchTokensFetcher.ts
View file @
ceed5e0b
...
@@ -15,8 +15,7 @@ export const fetchSearchTokens = async (tokenQuery: string): Promise<FungibleTok
...
@@ -15,8 +15,7 @@ export const fetchSearchTokens = async (tokenQuery: string): Promise<FungibleTok
const
data
=
await
r
.
json
()
const
data
=
await
r
.
json
()
// TODO Undo favoritism
// TODO Undo favoritism
return
(
return
data
.
data
data
.
data
&&
?
data
.
data
.
sort
((
a
:
FungibleToken
,
b
:
FungibleToken
)
=>
(
b
.
name
===
'
Uniswap
'
?
1
:
b
.
volume24h
-
a
.
volume24h
))
data
.
data
.
sort
((
a
:
FungibleToken
,
b
:
FungibleToken
)
=>
(
b
.
name
===
'
Uniswap
'
?
1
:
b
.
volume24h
-
a
.
volume24h
))
:
[]
)
}
}
src/nft/queries/genie/TrendingCollectionsFetcher.ts
View file @
ceed5e0b
...
@@ -18,5 +18,5 @@ export const fetchTrendingCollections = async (payload: {
...
@@ -18,5 +18,5 @@ export const fetchTrendingCollections = async (payload: {
const
data
=
await
r
.
json
()
const
data
=
await
r
.
json
()
return
data
return
data
??
[]
}
}
src/nft/queries/genie/TrendingTokensFetcher.ts
View file @
ceed5e0b
...
@@ -15,5 +15,5 @@ export const fetchTrendingTokens = async (numTokens?: number): Promise<FungibleT
...
@@ -15,5 +15,5 @@ export const fetchTrendingTokens = async (numTokens?: number): Promise<FungibleT
})
})
const
{
data
}
=
(
await
r
.
json
())
as
{
data
:
FungibleToken
[]
}
const
{
data
}
=
(
await
r
.
json
())
as
{
data
:
FungibleToken
[]
}
return
data
.
map
((
token
)
=>
unwrapToken
(
token
.
chainId
,
token
))
return
data
?
data
.
map
((
token
)
=>
unwrapToken
(
token
.
chainId
,
token
))
:
[]
}
}
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