Add title attribute to reply mentions in post subheader
This commit is contained in:
parent
7d4d9d31a4
commit
7d1a6d9efb
2 changed files with 8 additions and 5 deletions
|
@ -11,8 +11,8 @@
|
||||||
>
|
>
|
||||||
{{ authorName }}
|
{{ authorName }}
|
||||||
</router-link>
|
</router-link>
|
||||||
<div class="actor-address" :title="'@' + actorAddress">
|
<div class="actor-address" :title="'@' + getActorAddress(post.account)">
|
||||||
@{{ actorAddress }}
|
@{{ getActorAddress(post.account) }}
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
v-if="inThread && post.in_reply_to_id"
|
v-if="inThread && post.in_reply_to_id"
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
<router-link
|
<router-link
|
||||||
v-for="mention in replyingTo"
|
v-for="mention in replyingTo"
|
||||||
:to="{ name: 'profile', params: { profileId: mention.id }}"
|
:to="{ name: 'profile', params: { profileId: mention.id }}"
|
||||||
|
:title="getActorAddress(mention)"
|
||||||
:key="mention.id"
|
:key="mention.id"
|
||||||
>
|
>
|
||||||
@{{ mention.username }}
|
@{{ mention.username }}
|
||||||
|
@ -212,6 +213,7 @@ import {
|
||||||
createRepost,
|
createRepost,
|
||||||
deleteRepost,
|
deleteRepost,
|
||||||
} from "@/api/posts"
|
} from "@/api/posts"
|
||||||
|
import { Profile } from "@/api/users"
|
||||||
import Avatar from "@/components/Avatar.vue"
|
import Avatar from "@/components/Avatar.vue"
|
||||||
import CryptoAddress from "@/components/CryptoAddress.vue"
|
import CryptoAddress from "@/components/CryptoAddress.vue"
|
||||||
import PostEditor from "@/components/PostEditor.vue"
|
import PostEditor from "@/components/PostEditor.vue"
|
||||||
|
@ -270,8 +272,8 @@ export default class PostComponent extends Vue {
|
||||||
return this.post.account.display_name || this.post.account.username
|
return this.post.account.display_name || this.post.account.username
|
||||||
}
|
}
|
||||||
|
|
||||||
get actorAddress(): string {
|
getActorAddress(profile: Profile | Mention): string {
|
||||||
return this.store.getActorAddress(this.post.account)
|
return this.store.getActorAddress(profile)
|
||||||
}
|
}
|
||||||
|
|
||||||
highlight(postId: string | null) {
|
highlight(postId: string | null) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
|
|
||||||
import { InstanceInfo, getInstanceInfo } from "@/api/instance"
|
import { InstanceInfo, getInstanceInfo } from "@/api/instance"
|
||||||
|
import { Mention } from "@/api/posts"
|
||||||
import { Profile } from "@/api/users"
|
import { Profile } from "@/api/users"
|
||||||
|
|
||||||
const instance = ref<InstanceInfo | null>(null)
|
const instance = ref<InstanceInfo | null>(null)
|
||||||
|
@ -11,7 +12,7 @@ export function useInstanceInfo() {
|
||||||
instance.value = await getInstanceInfo()
|
instance.value = await getInstanceInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getActorAddress(profile: Profile): string {
|
function getActorAddress(profile: Profile | Mention): string {
|
||||||
if (profile.acct.includes("@")) {
|
if (profile.acct.includes("@")) {
|
||||||
// Remote account
|
// Remote account
|
||||||
return `${profile.acct}`
|
return `${profile.acct}`
|
||||||
|
|
Loading…
Reference in a new issue