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
6d5625a1
Unverified
Commit
6d5625a1
authored
May 03, 2021
by
Ian Lapham
Committed by
GitHub
May 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hot fix for token error parsing (#1382)
* hot fix for token list parsing * revert tsconfig
parent
d425ff64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
hooks.ts
src/state/lists/hooks.ts
+0
-2
updater.ts
src/state/lists/updater.ts
+8
-1
No files found.
src/state/lists/hooks.ts
View file @
6d5625a1
...
@@ -103,10 +103,8 @@ function combineMaps(map1: TokenAddressMap, map2: TokenAddressMap): TokenAddress
...
@@ -103,10 +103,8 @@ function combineMaps(map1: TokenAddressMap, map2: TokenAddressMap): TokenAddress
// merge tokens contained within lists from urls
// merge tokens contained within lists from urls
function
useCombinedTokenMapFromUrls
(
urls
:
string
[]
|
undefined
):
TokenAddressMap
{
function
useCombinedTokenMapFromUrls
(
urls
:
string
[]
|
undefined
):
TokenAddressMap
{
const
lists
=
useAllLists
()
const
lists
=
useAllLists
()
return
useMemo
(()
=>
{
return
useMemo
(()
=>
{
if
(
!
urls
)
return
EMPTY_LIST
if
(
!
urls
)
return
EMPTY_LIST
return
(
return
(
urls
urls
.
slice
()
.
slice
()
...
...
src/state/lists/updater.ts
View file @
6d5625a1
...
@@ -7,7 +7,7 @@ import { useFetchListCallback } from '../../hooks/useFetchListCallback'
...
@@ -7,7 +7,7 @@ import { useFetchListCallback } from '../../hooks/useFetchListCallback'
import
useInterval
from
'
../../hooks/useInterval
'
import
useInterval
from
'
../../hooks/useInterval
'
import
useIsWindowVisible
from
'
../../hooks/useIsWindowVisible
'
import
useIsWindowVisible
from
'
../../hooks/useIsWindowVisible
'
import
{
AppDispatch
}
from
'
../index
'
import
{
AppDispatch
}
from
'
../index
'
import
{
acceptListUpdate
}
from
'
./actions
'
import
{
acceptListUpdate
,
removeList
}
from
'
./actions
'
import
{
useActiveListUrls
}
from
'
./hooks
'
import
{
useActiveListUrls
}
from
'
./hooks
'
import
{
useAllInactiveTokens
}
from
'
hooks/Tokens
'
import
{
useAllInactiveTokens
}
from
'
hooks/Tokens
'
import
{
UNSUPPORTED_LIST_URLS
}
from
'
constants/lists
'
import
{
UNSUPPORTED_LIST_URLS
}
from
'
constants/lists
'
...
@@ -35,6 +35,13 @@ export default function Updater(): null {
...
@@ -35,6 +35,13 @@ export default function Updater(): null {
// fetch all lists every 10 minutes, but only after we initialize library
// fetch all lists every 10 minutes, but only after we initialize library
useInterval
(
fetchAllListsCallback
,
library
?
1000
*
60
*
10
:
null
)
useInterval
(
fetchAllListsCallback
,
library
?
1000
*
60
*
10
:
null
)
// hot fix for fetching error
useEffect
(()
=>
{
if
(
lists
[
'
https://tokens.coingecko.com/uniswap/all.json
'
])
{
dispatch
(
removeList
(
'
https://tokens.coingecko.com/uniswap/all.json
'
))
}
},
[
dispatch
,
lists
])
// whenever a list is not loaded and not loading, try again to load it
// whenever a list is not loaded and not loading, try again to load it
useEffect
(()
=>
{
useEffect
(()
=>
{
Object
.
keys
(
lists
).
forEach
(
listUrl
=>
{
Object
.
keys
(
lists
).
forEach
(
listUrl
=>
{
...
...
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