mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Don't allow library name with leading or trailing space
This commit is contained in:
parent
af3e7ac41e
commit
e83f45e75c
2 changed files with 13 additions and 0 deletions
|
@ -45,6 +45,18 @@ function onAddLibrary(e) {
|
|||
const name = dlg.querySelector('#txtValue').value;
|
||||
let type = dlg.querySelector('#selectCollectionType').value;
|
||||
|
||||
if (name.length == 0 || name.trim().length !== name.length) {
|
||||
alert({
|
||||
text: globalize.translate('LibraryNameInvalid'),
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
isCreating = false;
|
||||
loading.hide();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type == 'mixed') {
|
||||
type = null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue