fix: Error on release and collection page if user isn't authorized

This commit is contained in:
Kentai Radiquum 2024-08-27 14:27:49 +05:00
parent ea44bbf0e1
commit 5b68da425b
Signed by: Radiquum
GPG key ID: 858E8EE696525EED
3 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ export const ReleaseInfoUserList = (props: {
setUserList: any;
setIsFavorite: any;
collection_count: number;
profile_id: number;
profile_id: number | null;
}) => {
const [AddReleaseToCollectionModalOpen, setAddReleaseToCollectionModalOpen] =
useState(false);

View file

@ -97,7 +97,7 @@ export function CollectionsFullPage(props: {
sectionTitle={props.title}
content={content}
isMyCollections={
props.type == "profile" && props.profile_id == userStore.user.id
props.type == "profile" && userStore.user && props.profile_id == userStore.user.id
}
/>
) : !isLoadingEnd || isLoading ? (

View file

@ -86,7 +86,7 @@ export const ReleasePage = (props: any) => {
isFavorite={userFavorite}
release_id={data.release.id}
token={userStore.token}
profile_id={userStore.user.id}
profile_id={userStore.user ? userStore.user.id : null}
setUserList={setUserList}
setIsFavorite={setUserFavorite}
collection_count={data.release.collection_count}