Fix thread navigation
This commit is contained in:
parent
158922fcbd
commit
44bbd73b65
1 changed files with 3 additions and 4 deletions
|
@ -26,7 +26,7 @@
|
||||||
title="Go to previous post"
|
title="Go to previous post"
|
||||||
@mouseover="highlight(post.in_reply_to_id)"
|
@mouseover="highlight(post.in_reply_to_id)"
|
||||||
@mouseleave="highlight(null)"
|
@mouseleave="highlight(null)"
|
||||||
@click="navigateTo(post.in_reply_to_id)"
|
@click="navigateTo($event, post.in_reply_to_id)"
|
||||||
>
|
>
|
||||||
<img :src="require('@/assets/tabler/corner-left-up.svg')">
|
<img :src="require('@/assets/tabler/corner-left-up.svg')">
|
||||||
</a>
|
</a>
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
<a
|
<a
|
||||||
class="timestamp"
|
class="timestamp"
|
||||||
:href="post.uri"
|
:href="post.uri"
|
||||||
@click="navigateTo($event)"
|
@click="navigateTo($event, post.id)"
|
||||||
>
|
>
|
||||||
{{ humanizeDate(post.created_at) }}
|
{{ humanizeDate(post.created_at) }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -339,13 +339,12 @@ function highlight(postId: string | null) {
|
||||||
emit("highlight", postId)
|
emit("highlight", postId)
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateTo(event: Event) {
|
function navigateTo(event: Event, postId: string) {
|
||||||
if (currentUser === null) {
|
if (currentUser === null) {
|
||||||
// Viewing as guest; do not override click handler
|
// Viewing as guest; do not override click handler
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
const postId = props.post.id
|
|
||||||
if (props.inThread) {
|
if (props.inThread) {
|
||||||
emit("navigate-to", postId)
|
emit("navigate-to", postId)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue