Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
686f24b98e | ||
|
|
40d8da42a5 | ||
|
|
2151ffbac7 |
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@ -0,0 +1 @@
|
|||||||
|
@uniswap/web-admins
|
||||||
@ -24,12 +24,12 @@ class TokenSafetyLookupTable {
|
|||||||
this.initialized = true
|
this.initialized = true
|
||||||
|
|
||||||
// Initialize extended tokens first
|
// Initialize extended tokens first
|
||||||
lists.byUrl[UNI_EXTENDED_LIST].current?.tokens.forEach((token) => {
|
lists.byUrl[UNI_EXTENDED_LIST]?.current?.tokens.forEach((token) => {
|
||||||
this.dict[token.address.toLowerCase()] = TOKEN_LIST_TYPES.UNI_EXTENDED
|
this.dict[token.address.toLowerCase()] = TOKEN_LIST_TYPES.UNI_EXTENDED
|
||||||
})
|
})
|
||||||
|
|
||||||
// Initialize default tokens second, so that any tokens on both default and extended will display as default (no warning)
|
// Initialize default tokens second, so that any tokens on both default and extended will display as default (no warning)
|
||||||
lists.byUrl[UNI_LIST].current?.tokens.forEach((token) => {
|
lists.byUrl[UNI_LIST]?.current?.tokens.forEach((token) => {
|
||||||
this.dict[token.address.toLowerCase()] = TOKEN_LIST_TYPES.UNI_DEFAULT
|
this.dict[token.address.toLowerCase()] = TOKEN_LIST_TYPES.UNI_DEFAULT
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class TokenSafetyLookupTable {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// Initialize blocked tokens from all urls included
|
// Initialize blocked tokens from all urls included
|
||||||
UNSUPPORTED_LIST_URLS.map((url) => lists.byUrl[url].current?.tokens)
|
UNSUPPORTED_LIST_URLS.map((url) => lists.byUrl[url]?.current?.tokens)
|
||||||
.filter((x): x is TokenInfo[] => !!x)
|
.filter((x): x is TokenInfo[] => !!x)
|
||||||
.flat(1)
|
.flat(1)
|
||||||
.forEach((token) => {
|
.forEach((token) => {
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import { useEffect } from 'react'
|
|||||||
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
||||||
import { updateSelectedWallet } from 'state/user/reducer'
|
import { updateSelectedWallet } from 'state/user/reducer'
|
||||||
|
|
||||||
|
import { useStateRehydrated } from './useStateRehydrated'
|
||||||
|
|
||||||
async function connect(connector: Connector) {
|
async function connect(connector: Connector) {
|
||||||
try {
|
try {
|
||||||
if (connector.connectEagerly) {
|
if (connector.connectEagerly) {
|
||||||
@ -21,7 +23,7 @@ export default function useEagerlyConnect() {
|
|||||||
const dispatch = useAppDispatch()
|
const dispatch = useAppDispatch()
|
||||||
|
|
||||||
const selectedWallet = useAppSelector((state) => state.user.selectedWallet)
|
const selectedWallet = useAppSelector((state) => state.user.selectedWallet)
|
||||||
const rehydrated = useAppSelector((state) => state._persist.rehydrated)
|
const rehydrated = useStateRehydrated()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
5
src/hooks/useStateRehydrated.ts
Normal file
5
src/hooks/useStateRehydrated.ts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { useAppSelector } from 'state/hooks'
|
||||||
|
|
||||||
|
export function useStateRehydrated() {
|
||||||
|
return useAppSelector((state) => state._persist.rehydrated)
|
||||||
|
}
|
||||||
3602
src/locales/af-ZA.po
Normal file
3602
src/locales/af-ZA.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ar-SA.po
Normal file
3602
src/locales/ar-SA.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ca-ES.po
Normal file
3602
src/locales/ca-ES.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/cs-CZ.po
Normal file
3602
src/locales/cs-CZ.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/da-DK.po
Normal file
3602
src/locales/da-DK.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/de-DE.po
Normal file
3602
src/locales/de-DE.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/el-GR.po
Normal file
3602
src/locales/el-GR.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/es-ES.po
Normal file
3602
src/locales/es-ES.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/fi-FI.po
Normal file
3602
src/locales/fi-FI.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/fr-FR.po
Normal file
3602
src/locales/fr-FR.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/he-IL.po
Normal file
3602
src/locales/he-IL.po
Normal file
File diff suppressed because it is too large
Load Diff
3603
src/locales/hu-HU.po
Normal file
3603
src/locales/hu-HU.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/id-ID.po
Normal file
3602
src/locales/id-ID.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/it-IT.po
Normal file
3602
src/locales/it-IT.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ja-JP.po
Normal file
3602
src/locales/ja-JP.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ko-KR.po
Normal file
3602
src/locales/ko-KR.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/nl-NL.po
Normal file
3602
src/locales/nl-NL.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/no-NO.po
Normal file
3602
src/locales/no-NO.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/pl-PL.po
Normal file
3602
src/locales/pl-PL.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/pt-BR.po
Normal file
3602
src/locales/pt-BR.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/pt-PT.po
Normal file
3602
src/locales/pt-PT.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ro-RO.po
Normal file
3602
src/locales/ro-RO.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/ru-RU.po
Normal file
3602
src/locales/ru-RU.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/sl-SI.po
Normal file
3602
src/locales/sl-SI.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/sr-SP.po
Normal file
3602
src/locales/sr-SP.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/sv-SE.po
Normal file
3602
src/locales/sv-SE.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/sw-TZ.po
Normal file
3602
src/locales/sw-TZ.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/th-TH.po
Normal file
3602
src/locales/th-TH.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/tr-TR.po
Normal file
3602
src/locales/tr-TR.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/uk-UA.po
Normal file
3602
src/locales/uk-UA.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/vi-VN.po
Normal file
3602
src/locales/vi-VN.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/zh-CN.po
Normal file
3602
src/locales/zh-CN.po
Normal file
File diff suppressed because it is too large
Load Diff
3602
src/locales/zh-TW.po
Normal file
3602
src/locales/zh-TW.po
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@ import { getVersionUpgrade, VersionUpgrade } from '@uniswap/token-lists'
|
|||||||
import { useWeb3React } from '@web3-react/core'
|
import { useWeb3React } from '@web3-react/core'
|
||||||
import { DEFAULT_LIST_OF_LISTS, UNSUPPORTED_LIST_URLS } from 'constants/lists'
|
import { DEFAULT_LIST_OF_LISTS, UNSUPPORTED_LIST_URLS } from 'constants/lists'
|
||||||
import TokenSafetyLookupTable from 'constants/tokenSafetyLookup'
|
import TokenSafetyLookupTable from 'constants/tokenSafetyLookup'
|
||||||
|
import { useStateRehydrated } from 'hooks/useStateRehydrated'
|
||||||
import useInterval from 'lib/hooks/useInterval'
|
import useInterval from 'lib/hooks/useInterval'
|
||||||
import ms from 'ms'
|
import ms from 'ms'
|
||||||
import { useCallback, useEffect } from 'react'
|
import { useCallback, useEffect } from 'react'
|
||||||
@ -21,10 +22,11 @@ export default function Updater(): null {
|
|||||||
// get all loaded lists, and the active urls
|
// get all loaded lists, and the active urls
|
||||||
const lists = useAllLists()
|
const lists = useAllLists()
|
||||||
const listsState = useAppSelector((state) => state.lists)
|
const listsState = useAppSelector((state) => state.lists)
|
||||||
|
const rehydrated = useStateRehydrated()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
TokenSafetyLookupTable.update(listsState)
|
if (rehydrated) TokenSafetyLookupTable.update(listsState)
|
||||||
}, [listsState])
|
}, [listsState, rehydrated])
|
||||||
|
|
||||||
const fetchList = useFetchListCallback()
|
const fetchList = useFetchListCallback()
|
||||||
const fetchAllListsCallback = useCallback(() => {
|
const fetchAllListsCallback = useCallback(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user