Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
d674f8500f | ||
|
686f24b98e | ||
|
40d8da42a5 | ||
|
2151ffbac7 |
CODEOWNERS
src
constants
hooks
locales
af-ZA.poar-SA.poca-ES.pocs-CZ.poda-DK.pode-DE.poel-GR.poes-ES.pofi-FI.pofr-FR.pohe-IL.pohu-HU.poid-ID.poit-IT.poja-JP.poko-KR.ponl-NL.pono-NO.popl-PL.popt-BR.popt-PT.poro-RO.poru-RU.posl-SI.posr-SP.posv-SE.posw-TZ.poth-TH.potr-TR.pouk-UA.povi-VN.pozh-CN.pozh-TW.po
state/lists
tracing
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@ -0,0 +1 @@
|
||||
@uniswap/web-admins
|
@ -24,12 +24,12 @@ class TokenSafetyLookupTable {
|
||||
this.initialized = true
|
||||
|
||||
// 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
|
||||
})
|
||||
|
||||
// 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
|
||||
})
|
||||
|
||||
@ -39,7 +39,7 @@ class TokenSafetyLookupTable {
|
||||
})
|
||||
|
||||
// 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)
|
||||
.flat(1)
|
||||
.forEach((token) => {
|
||||
|
@ -5,6 +5,8 @@ import { useEffect } from 'react'
|
||||
import { useAppDispatch, useAppSelector } from 'state/hooks'
|
||||
import { updateSelectedWallet } from 'state/user/reducer'
|
||||
|
||||
import { useStateRehydrated } from './useStateRehydrated'
|
||||
|
||||
async function connect(connector: Connector) {
|
||||
try {
|
||||
if (connector.connectEagerly) {
|
||||
@ -21,7 +23,7 @@ export default function useEagerlyConnect() {
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
const selectedWallet = useAppSelector((state) => state.user.selectedWallet)
|
||||
const rehydrated = useAppSelector((state) => state._persist.rehydrated)
|
||||
const rehydrated = useStateRehydrated()
|
||||
|
||||
useEffect(() => {
|
||||
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 { DEFAULT_LIST_OF_LISTS, UNSUPPORTED_LIST_URLS } from 'constants/lists'
|
||||
import TokenSafetyLookupTable from 'constants/tokenSafetyLookup'
|
||||
import { useStateRehydrated } from 'hooks/useStateRehydrated'
|
||||
import useInterval from 'lib/hooks/useInterval'
|
||||
import ms from 'ms'
|
||||
import { useCallback, useEffect } from 'react'
|
||||
@ -21,10 +22,11 @@ export default function Updater(): null {
|
||||
// get all loaded lists, and the active urls
|
||||
const lists = useAllLists()
|
||||
const listsState = useAppSelector((state) => state.lists)
|
||||
const rehydrated = useStateRehydrated()
|
||||
|
||||
useEffect(() => {
|
||||
TokenSafetyLookupTable.update(listsState)
|
||||
}, [listsState])
|
||||
if (rehydrated) TokenSafetyLookupTable.update(listsState)
|
||||
}, [listsState, rehydrated])
|
||||
|
||||
const fetchList = useFetchListCallback()
|
||||
const fetchAllListsCallback = useCallback(() => {
|
||||
|
@ -2,7 +2,8 @@
|
||||
* Returns the time elapsed between page load and now.
|
||||
* @param markName the identifier for the performance mark to be created and measured.
|
||||
*/
|
||||
export function calculateElapsedTimeWithPerformanceMark(markName: string): number {
|
||||
export function calculateElapsedTimeWithPerformanceMark(markName: string): number | undefined {
|
||||
const elapsedTime = performance.mark(markName)
|
||||
if (!elapsedTime) return undefined
|
||||
return elapsedTime.startTime
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user