Skip to content

Commit

Permalink
Fix/nft cache (#219)
Browse files Browse the repository at this point in the history
* Added request at home render, removed validation on empty collections for loading

* Fix crash

* Removed duplicated call
  • Loading branch information
rocky-fleek authored Sep 17, 2021
1 parent 7ad4c6e commit f222e75
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions source/Popup/Views/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
});
Expand Down

0 comments on commit f222e75

Please sign in to comment.