Fixed tiles breaking if user is not logged in.
This commit is contained in:
parent
ad635d4192
commit
b5b3ad57bf
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="tile"
|
||||
:class="{
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id,
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user?.id,
|
||||
}"
|
||||
>
|
||||
<span class="name">{{ actor.name }}</span>
|
||||
|
@ -88,7 +88,7 @@ const props = defineProps({
|
|||
const pageContext = inject('pageContext');
|
||||
const { user } = pageContext;
|
||||
const pageStash = pageContext.pageProps.stash;
|
||||
const currentStash = pageStash || user.primaryStash;
|
||||
const currentStash = pageStash || user?.primaryStash;
|
||||
|
||||
const favorited = ref(props.actor.stashes.some((actorStash) => actorStash.id === currentStash.id));
|
||||
</script>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="movie-tile"
|
||||
:class="{
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id,
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user?.id,
|
||||
}"
|
||||
>
|
||||
<div
|
||||
|
@ -120,7 +120,7 @@ const props = defineProps({
|
|||
const pageContext = inject('pageContext');
|
||||
const user = pageContext.user;
|
||||
const pageStash = pageContext.pageProps.stash;
|
||||
const currentStash = pageStash || user.primaryStash;
|
||||
const currentStash = pageStash || user?.primaryStash;
|
||||
|
||||
const currentYear = new Date().getFullYear();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="tile"
|
||||
:class="{
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id,
|
||||
unstashed: !favorited && pageStash && user && pageStash.user.id === user?.id,
|
||||
'is-new': scene.isNew,
|
||||
}"
|
||||
>
|
||||
|
@ -126,7 +126,7 @@ const props = defineProps({
|
|||
const pageContext = inject('pageContext');
|
||||
const user = pageContext.user;
|
||||
const pageStash = pageContext.pageProps.stash;
|
||||
const currentStash = pageStash || user.primaryStash;
|
||||
const currentStash = pageStash || user?.primaryStash;
|
||||
|
||||
const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === currentStash.id));
|
||||
</script>
|
||||
|
|
|
@ -71,7 +71,7 @@ const props = defineProps({
|
|||
const emit = defineEmits(['stashed', 'unstashed']);
|
||||
|
||||
const { user, pageProps } = inject('pageContext');
|
||||
const currentStash = pageProps.stash || user.primaryStash;
|
||||
const currentStash = pageProps.stash || user?.primaryStash;
|
||||
|
||||
const itemStashes = ref(props.item.stashes);
|
||||
|
||||
|
|
Loading…
Reference in New Issue