Fix load safe tokens when safe is in store before v3.5.0
This commit is contained in:
parent
3499b7bb87
commit
86d8fe3a51
|
@ -1,3 +1,4 @@
|
||||||
|
import * as Sentry from '@sentry/react'
|
||||||
import { List } from 'immutable'
|
import { List } from 'immutable'
|
||||||
import { createSelector } from 'reselect'
|
import { createSelector } from 'reselect'
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ export const extendedSafeTokensSelector = createSelector(
|
||||||
(safeBalances, tokensList, ethAsToken): List<Token> => {
|
(safeBalances, tokensList, ethAsToken): List<Token> => {
|
||||||
const extendedTokens: Array<Token> = []
|
const extendedTokens: Array<Token> = []
|
||||||
|
|
||||||
|
try {
|
||||||
safeBalances.forEach((safeBalance) => {
|
safeBalances.forEach((safeBalance) => {
|
||||||
const tokenAddress = safeBalance.tokenAddress
|
const tokenAddress = safeBalance.tokenAddress
|
||||||
|
|
||||||
|
@ -49,6 +51,12 @@ export const extendedSafeTokensSelector = createSelector(
|
||||||
})
|
})
|
||||||
|
|
||||||
return List(extendedTokens)
|
return List(extendedTokens)
|
||||||
|
} catch (e) {
|
||||||
|
Sentry.captureMessage(
|
||||||
|
'There was an error loading `safeBalances` in `extendedSafeTokensSelector`, probably safe loaded prior to v3.5.0',
|
||||||
|
)
|
||||||
|
return List([])
|
||||||
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue