From f222e7548b3430cf6bc8564580d0c80a167c2048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Rocchi?= <84542297+rocky-fleek@users.noreply.github.com> Date: Fri, 17 Sep 2021 14:33:53 -0300 Subject: [PATCH] Fix/nft cache (#219) * Added request at home render, removed validation on empty collections for loading * Fix crash * Removed duplicated call --- source/Popup/Views/Home/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/Popup/Views/Home/index.jsx b/source/Popup/Views/Home/index.jsx index c5e67cbc..f02dbc4a 100644 --- a/source/Popup/Views/Home/index.jsx +++ b/source/Popup/Views/Home/index.jsx @@ -54,19 +54,19 @@ const Home = () => { console.warn(err); } - sendMessage({ - type: HANDLER_TYPES.GET_NFTS, - params: { refresh: true }, - }, (nftCollections) => { - dispatch(setCollections({ collections: nftCollections, walletNumber })); - dispatch(setCollectionsLoading(false)); - }); - sendMessage({ type: HANDLER_TYPES.GET_STATE, params: {} }, (state) => { if (!state?.wallets?.length) { sendMessage({ type: HANDLER_TYPES.LOCK, params: {} }, () => navigator.navigate('login')); + } else { + sendMessage({ + type: HANDLER_TYPES.GET_NFTS, + params: { refresh: true }, + }, (nftCollections) => { + dispatch(setCollections({ collections: nftCollections, walletNumber })); + dispatch(setCollectionsLoading(false)); + }); } dispatch(setAccountInfo(state.wallets[state.currentWalletId])); });