Skip to content

Commit

Permalink
catch fetch errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NickJ202 committed Nov 15, 2023
1 parent efc208d commit 913c6f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
7 changes: 6 additions & 1 deletion app/src/store/assets/ReduxAssetsUpdate/ReduxAssetsUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ export default function ReduxAssetsUpdate(props: {
});

const rankByStamps = props.activeSort === 'by-stamps' || props.apiFetch === 'user';
const stampAssets = await getStampData(assets, window.arweaveWallet, rankByStamps, dreReducer.source);
let stampAssets;
try {
stampAssets = await getStampData(assets, window.arweaveWallet, rankByStamps, dreReducer.source);
} catch (e: any) {
stampAssets = assets;
}

const featuredStampAssets = sortAssets(
stampAssets.filter((_stampAsset, index) => cursorReducer.featuredGroup.includes(assets[index].data.id)),
Expand Down
18 changes: 11 additions & 7 deletions app/src/views/Landing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ export default function Landing() {
const collectionsFetch = await getCollections({ cursor: null });
setCollections(collectionsFetch.collections);

const stampCollections = await getStampData(
collectionsFetch.collections,
window.arweaveWallet,
true,
dreReducer.source
);
setCollections(stampCollections);
try {
const stampCollections = await getStampData(
collectionsFetch.collections,
window.arweaveWallet,
true,
dreReducer.source
);
setCollections(stampCollections);
} catch (e: any) {
console.error(e);
}
} catch (e: any) {
console.error(e);
setCollections([]);
Expand Down

0 comments on commit 913c6f3

Please sign in to comment.