fix isSharedCollection

This commit is contained in:
abhinav-grd 2021-09-21 11:56:26 +05:30
parent 801ff1a856
commit ae881e6a4f

View file

@ -66,8 +66,12 @@ export function isSharedCollection(
collectionID: number
) {
const user: User = getData(LS_KEYS.USER);
return (
collections.find((collection) => collection.id === collectionID)?.owner
.id !== user.id
const collection = collections.find(
(collection) => collection.id === collectionID
);
if (!collection) {
return false;
}
return collection?.owner.id !== user.id;
}