fix(components): add null check to singleStory.vue
if author is null for some reason, show a static "..." instead of breaking everything
This commit is contained in:
parent
f8913e976d
commit
83c1379ba6
@ -21,9 +21,9 @@
|
|||||||
<template #title>
|
<template #title>
|
||||||
<div style="padding-top: 1em; padding-bottom: 0.8em">
|
<div style="padding-top: 1em; padding-bottom: 0.8em">
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<NuxtLink :to="`/story/${story._id}/${idxo + 1}`">
|
<nuxt-link :to="`/story/${story._id}/${idxo + 1}`">
|
||||||
{{ story.title }}
|
{{ story.title }}
|
||||||
</NuxtLink>
|
</nuxt-link>
|
||||||
<a-tooltip placement="topLeft">
|
<a-tooltip placement="topLeft">
|
||||||
<template #title> You'll need to log in to read this story. Register if you don't already have an account -- it's free! </template>
|
<template #title> You'll need to log in to read this story. Register if you don't already have an account -- it's free! </template>
|
||||||
<icon v-if="!data?.user" istyle="solid" name="lock" />
|
<icon v-if="!data?.user" istyle="solid" name="lock" />
|
||||||
@ -38,11 +38,12 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span> fic by </span>
|
<span> fic by </span>
|
||||||
<span>
|
<span v-if="story.author">
|
||||||
<NuxtLink :to="`/user/${story.author._id}`">
|
<NuxtLink :to="`/user/${story.author._id}`">
|
||||||
{{ story.author.username }}
|
{{ story.author.username }}
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else>...</span>
|
||||||
<span v-if="story.coAuthor">
|
<span v-if="story.coAuthor">
|
||||||
and
|
and
|
||||||
<NuxtLink :to="`/user/${story.coAuthor._id}`">
|
<NuxtLink :to="`/user/${story.coAuthor._id}`">
|
||||||
|
Loading…
Reference in New Issue
Block a user