Skip to content

Commit 3c835a4

Browse files
authored
Merge pull request #1880 from nextcloud-libraries/backport/1841/main
2 parents 6d6ea1e + 7e7bd5e commit 3c835a4

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

l10n/messages.pot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ msgstr ""
154154
msgid "Upload some content or sync with your devices!"
155155
msgstr ""
156156

157+
msgid "You are currently identified as {nickname}."
158+
msgstr ""
159+
157160
msgid "You are currently not identified."
158161
msgstr ""
159162

lib/components/PublicAuthPrompt.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface PublicAuthPromptProps {
5252
5353
const props = withDefaults(defineProps<PublicAuthPromptProps>(), {
5454
nickname: '',
55-
notice: t('You are currently not identified.'),
55+
notice: '',
5656
submitLabel: t('Submit name'),
5757
text: '',
5858
title: t('Guest identification'),
@@ -104,6 +104,20 @@ const buttons = computed(() => {
104104
return [submitButton]
105105
})
106106
107+
const defaultNotice = computed(() => {
108+
if (props.notice) {
109+
return props.notice
110+
}
111+
112+
// If no notice is provided, use a default one
113+
// that changes based on the nickname definition
114+
if (name.value) {
115+
return t('You are currently identified as {nickname}.', { nickname: name.value })
116+
}
117+
118+
return t('You are currently not identified.')
119+
})
120+
107121
/**
108122
* Handle saving the nickname and return it.
109123
*/
@@ -169,7 +183,7 @@ function onSubmit() {
169183
<!-- Header -->
170184
<NcNoteCard
171185
class="public-auth-prompt__header"
172-
:text="notice"
186+
:text="defaultNotice"
173187
type="info" />
174188

175189
<!-- Form -->

0 commit comments

Comments
 (0)