Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(files_sharing): show message when nickname is not valid
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Jun 5, 2025
commit 972a73e8bce8430de4d937fa48d9a90bb7ca7813
19 changes: 18 additions & 1 deletion apps/files_sharing/src/views/PublicAuthPrompt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@

<script lang="ts">
import { defineComponent } from 'vue'
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'

import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import { loadState } from '@nextcloud/initial-state'

import { getFilenameValidity } from '../../../files/src/utils/filenameValidity'

export default defineComponent({
name: 'PublicAuthPrompt',
Expand Down Expand Up @@ -91,6 +93,21 @@ export default defineComponent({
},
},

watch: {
name() {
// Check validity of the new name
const newName = this.name.trim?.() || ''
const input = (this.$refs.input as Vue|undefined)?.$el.querySelector('input')
if (!input) {
return
}

const validity = getFilenameValidity(newName)
input.setCustomValidity(validity)
input.reportValidity()
},
},

beforeMount() {
// Pre-load the name from local storage if already set by another app
// like Talk, Colabora or Text...
Expand Down