fix crash opening user items page logged out

This commit is contained in:
Emi Matchu 2020-10-23 22:19:54 -07:00
parent 49d3b3685d
commit bb46c1f184

View file

@ -70,9 +70,11 @@ function UserItemsPage() {
return <Box color="red.400">{error.message}</Box>; return <Box color="red.400">{error.message}</Box>;
} }
const itemIdsYouOwn = new Set(data.currentUser.itemsTheyOwn.map((i) => i.id)); const itemIdsYouOwn = new Set(
data.currentUser?.itemsTheyOwn.map((i) => i.id) || []
);
const itemIdsYouWant = new Set( const itemIdsYouWant = new Set(
data.currentUser.itemsTheyWant.map((i) => i.id) data.currentUser?.itemsTheyWant.map((i) => i.id) || []
); );
// This helps you compare your owns/wants to other users! If they own // This helps you compare your owns/wants to other users! If they own