FIX: Show the account avatar when displaying a user profile to an unauthenticated user.

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
pull/746/head
Cyrille Bollu 2019-09-19 10:45:44 +02:00
rodzic 9fac5aea32
commit 2f7683a0ae
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -23,7 +23,7 @@
<template>
<div v-if="account && accountInfo" class="user-profile">
<div>
<avatar v-if="accountInfo.local" :user="uid" :disable-tooltip="true"
<avatar v-if="accountInfo.local" :user="localUid" :disable-tooltip="true"
:size="128" />
<avatar v-else :url="avatarUrl" :disable-tooltip="true"
:size="128" />
@ -125,6 +125,10 @@ export default {
}
},
computed: {
localUid() {
// Returns only the local part of a username
return (this.uid.indexOf('@') === -1) ? this.uid : this.uid.substr(0, this.uid.indexOf('@'))
},
account() {
return (this.uid.indexOf('@') === -1) ? this.uid + '@' + this.hostname : this.uid
},