From 7e7bd5e925688b89ba999543f42d81dd21075dd2 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 10 Jun 2025 18:14:03 +0200 Subject: [PATCH] fix(PublicAuthPrompt): change default notice if identified Signed-off-by: skjnldsv --- l10n/messages.pot | 3 +++ lib/components/PublicAuthPrompt.vue | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/l10n/messages.pot b/l10n/messages.pot index ad6eded33..a858a7e9e 100644 --- a/l10n/messages.pot +++ b/l10n/messages.pot @@ -154,6 +154,9 @@ msgstr "" msgid "Upload some content or sync with your devices!" msgstr "" +msgid "You are currently identified as {nickname}." +msgstr "" + msgid "You are currently not identified." msgstr "" diff --git a/lib/components/PublicAuthPrompt.vue b/lib/components/PublicAuthPrompt.vue index d772755c9..cd87c11ec 100644 --- a/lib/components/PublicAuthPrompt.vue +++ b/lib/components/PublicAuthPrompt.vue @@ -52,7 +52,7 @@ export interface PublicAuthPromptProps { const props = withDefaults(defineProps(), { nickname: '', - notice: t('You are currently not identified.'), + notice: '', submitLabel: t('Submit name'), text: '', title: t('Guest identification'), @@ -104,6 +104,20 @@ const buttons = computed(() => { return [submitButton] }) +const defaultNotice = computed(() => { + if (props.notice) { + return props.notice + } + + // If no notice is provided, use a default one + // that changes based on the nickname definition + if (name.value) { + return t('You are currently identified as {nickname}.', { nickname: name.value }) + } + + return t('You are currently not identified.') +}) + /** * Handle saving the nickname and return it. */ @@ -169,7 +183,7 @@ function onSubmit() {