diff options
author | Julius Härtl <jus@bitgrid.net> | 2020-07-31 13:18:47 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2020-08-05 17:01:30 +0200 |
commit | bd3d791ee032acd61ad7e62bb10a88a6335dcc39 (patch) | |
tree | c4038a5267ef7f6797ee59a639f016f165777f25 | |
parent | c983094625e37c7062845edb929674cd2091b4c3 (diff) | |
download | nextcloud-server-bd3d791ee032acd61ad7e62bb10a88a6335dcc39.tar.gz nextcloud-server-bd3d791ee032acd61ad7e62bb10a88a6335dcc39.zip |
Only show display name if set
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | apps/dashboard/src/App.vue | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/dashboard/src/App.vue b/apps/dashboard/src/App.vue index 6680daea454..a87ce343706 100644 --- a/apps/dashboard/src/App.vue +++ b/apps/dashboard/src/App.vue @@ -74,7 +74,8 @@ export default { timer: new Date(), callbacks: {}, panels, - name: getCurrentUser()?.displayName, + displayName: getCurrentUser()?.displayName, + uid: getCurrentUser()?.uid, layout: loadState('dashboard', 'layout').filter((panelId) => panels[panelId]), modal: false, appStoreUrl: generateUrl('/settings/apps'), @@ -83,20 +84,21 @@ export default { computed: { greeting() { const time = this.timer.getHours() + const shouldShowName = this.displayName && this.uid !== this.displayName if (time > 18) { - return { icon: '🌙', text: t('dashboard', 'Good evening, {name}', { name: this.name }) } + return { icon: '🌙', text: shouldShowName ? t('dashboard', 'Good evening, {name}', { name: this.name }) : t('dashboard', 'Good evening') } } if (time > 12) { - return { icon: '☀', text: t('dashboard', 'Good afternoon, {name}', { name: this.name }) } + return { icon: '☀', text: shouldShowName ? t('dashboard', 'Good afternoon, {name}', { name: this.name }) : t('dashboard', 'Good afternoon') } } if (time === 12) { - return { icon: '🍽', text: t('dashboard', 'Time for lunch, {name}', { name: this.name }) } + return { icon: '🍽', text: shouldShowName ? t('dashboard', 'Time for lunch, {name}', { name: this.name }) : t('dashboard', 'Time for lunch') } } if (time > 5) { - return { icon: '🌄', text: t('dashboard', 'Good morning, {name}', { name: this.name }) } + return { icon: '🌄', text: shouldShowName ? t('dashboard', 'Good morning, {name}', { name: this.name }) : t('dashboard', 'Good morning') } } - return { icon: '🦉', text: t('dashboard', 'Have a night owl, {name}', { name: this.name }) } + return { icon: '🦉', text: shouldShowName ? t('dashboard', 'Have a night owl, {name}', { name: this.name }) : t('dashboard', 'Have a night owl') } }, isActive() { return (panel) => this.layout.indexOf(panel.id) > -1 |