Skip to content

Commit 7c1c8d7

Browse files
committed
WIP
1 parent fe41520 commit 7c1c8d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/scenes/CoinRankingScene.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const CoinRankingComponent = (props: Props) => {
143143
})
144144

145145
React.useEffect(() => {
146-
if (lastSceneFiat !== coingeckoFiat) {
146+
if (lastSceneFiat != null && lastSceneFiat !== coingeckoFiat) {
147147
// Clear cache if we changed the fiat while outside of this scene
148148
debugLog(LOG_COINRANK, 'Clearing coinRankingDatas cache')
149149
coinRanking.coinRankingDatas = []
@@ -230,7 +230,7 @@ const CoinRankingComponent = (props: Props) => {
230230
return () => {
231231
// Reset related query state when this effect is unmounted (coingeckoFiat
232232
// changed), but the scene is still mounted:
233-
if (mounted.current) {
233+
if (coingeckoFiat !== lastSceneFiat) {
234234
debugLog(LOG_COINRANK, `Clearing coinRankingDatas cache for new fiat: ${coingeckoFiat}`)
235235
clearTimeout(timeoutId)
236236
loopAbort()

0 commit comments

Comments
 (0)