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
a4493382
Unverified
Commit
a4493382
authored
Nov 22, 2022
by
cartcrom
Committed by
GitHub
Nov 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: searchbar fetching promise resolve fallback (#5380)
* added promise resolve fallback * removed extra indent
parent
9662344e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
SearchCollectionsFetcher.ts
src/nft/queries/genie/SearchCollectionsFetcher.ts
+3
-1
SearchTokensFetcher.ts
src/nft/queries/genie/SearchTokensFetcher.ts
+3
-1
TrendingCollectionsFetcher.ts
src/nft/queries/genie/TrendingCollectionsFetcher.ts
+3
-1
TrendingTokensFetcher.ts
src/nft/queries/genie/TrendingTokensFetcher.ts
+3
-1
No files found.
src/nft/queries/genie/SearchCollectionsFetcher.ts
View file @
a4493382
...
...
@@ -4,8 +4,10 @@ import { GenieCollection } from '../../types'
const
MAX_SEARCH_RESULTS
=
6
const
NFT_API_URL
=
process
.
env
.
REACT_APP_GENIE_V3_API_URL
export
const
fetchSearchCollections
=
async
(
addressOrName
:
string
,
recursive
=
false
):
Promise
<
GenieCollection
[]
>
=>
{
const
url
=
`
${
process
.
env
.
REACT_APP_GENIE_V3_API_URL
}
/searchCollections`
if
(
!
NFT_API_URL
)
return
Promise
.
resolve
([])
const
url
=
`
${
NFT_API_URL
}
/searchCollections`
const
isName
=
!
isAddress
(
addressOrName
.
toLowerCase
())
if
(
!
isName
&&
!
recursive
)
{
...
...
src/nft/queries/genie/SearchTokensFetcher.ts
View file @
a4493382
import
{
FungibleToken
}
from
'
../../types
'
const
TOKEN_API_URL
=
process
.
env
.
REACT_APP_TEMP_API_URL
export
const
fetchSearchTokens
=
async
(
tokenQuery
:
string
):
Promise
<
FungibleToken
[]
>
=>
{
const
url
=
`
${
process
.
env
.
REACT_APP_TEMP_API_URL
}
/tokens/search?tokenQuery=
${
tokenQuery
}
`
if
(
!
TOKEN_API_URL
)
return
Promise
.
resolve
([])
const
url
=
`
${
TOKEN_API_URL
}
/tokens/search?tokenQuery=
${
tokenQuery
}
`
const
r
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
...
...
src/nft/queries/genie/TrendingCollectionsFetcher.ts
View file @
a4493382
import
{
TimePeriod
,
TrendingCollection
}
from
'
../../types
'
const
NFT_API_URL
=
process
.
env
.
REACT_APP_GENIE_V3_API_URL
export
const
fetchTrendingCollections
=
async
(
payload
:
{
volumeType
:
'
eth
'
|
'
nft
'
timePeriod
:
TimePeriod
size
:
number
}):
Promise
<
TrendingCollection
[]
>
=>
{
const
url
=
`
${
process
.
env
.
REACT_APP_GENIE_V3_API_URL
}
/collections/trending`
if
(
!
NFT_API_URL
)
return
Promise
.
resolve
([])
const
url
=
`
${
NFT_API_URL
}
/collections/trending`
const
r
=
await
fetch
(
url
,
{
method
:
'
POST
'
,
headers
:
{
...
...
src/nft/queries/genie/TrendingTokensFetcher.ts
View file @
a4493382
...
...
@@ -2,8 +2,10 @@ import { unwrapToken } from 'graphql/data/util'
import
{
FungibleToken
}
from
'
../../types
'
const
TOKEN_API_URL
=
process
.
env
.
REACT_APP_TEMP_API_URL
export
const
fetchTrendingTokens
=
async
(
numTokens
?:
number
):
Promise
<
FungibleToken
[]
>
=>
{
const
url
=
`
${
process
.
env
.
REACT_APP_TEMP_API_URL
}
/tokens/trending
${
numTokens
?
`?numTokens=
${
numTokens
}
`
:
''
}
`
if
(
!
TOKEN_API_URL
)
return
Promise
.
resolve
([])
const
url
=
`
${
TOKEN_API_URL
}
/tokens/trending
${
numTokens
?
`?numTokens=
${
numTokens
}
`
:
''
}
`
const
r
=
await
fetch
(
url
,
{
method
:
'
GET
'
,
...
...
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