diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-01-03 10:18:38 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-01-03 10:18:38 +0100 |
commit | c3918c3ae8e4cbcc41a637bcccdc3305c41e7b8d (patch) | |
tree | 00a489c4ea9821b431132f0cedd62aeb5f987b55 /src | |
parent | 90dc46bd2be114dbb7595d1ef4ab7eb89cb5cf14 (diff) |
Properly link remote accounts
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/TimelineEntry.vue | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/components/TimelineEntry.vue b/src/components/TimelineEntry.vue index 37871372..693c526d 100644 --- a/src/components/TimelineEntry.vue +++ b/src/components/TimelineEntry.vue @@ -10,14 +10,10 @@ </div> <div class="post-content"> <div class="post-author-wrapper"> - <router-link v-if="item.actor_info && item.local" :to="{ name: 'profile', params: { account: item.actor_info.preferredUsername }}"> - <span class="post-author">{{ item.actor_info.preferredUsername }}</span> + <router-link v-if="item.actor_info" :to="{ name: 'profile', params: { account: item.local ? item.actor_info.preferredUsername : item.actor_info.account }}"> + <span class="post-author">{{ userDisplayName(item.actor_info) }}</span> <span class="post-author-id">{{ item.actor_info.account }}</span> </router-link> - <a v-else-if="item.actor_info" :href="item.actor_info.url"> - <span class="post-author">{{ item.actor_info.preferredUsername }}</span> - <span class="post-author-id">{{ item.actor_info.account }}</span> - </a> <a v-else :href="item.attributedTo"> <span class="post-author-id">{{ item.attributedTo }}</span> </a> @@ -69,6 +65,11 @@ export default { avatarUrl() { return OC.generateUrl('/apps/social/api/v1/global/actor/avatar?id=' + this.item.attributedTo) } + }, + methods: { + userDisplayName(actorInfo) { + return actorInfo.name !== '' ? actorInfo.name : actorInfo.preferredUsername + } } } </script> |