mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
fix(webui): perform case insensitive comparison for existing readlist or collection name
This commit is contained in:
parent
0984d9f8a4
commit
2f97395a24
4 changed files with 4 additions and 4 deletions
|
|
@ -116,7 +116,7 @@ export default Vue.extend({
|
|||
else return [this.series.id]
|
||||
},
|
||||
duplicate(): string {
|
||||
if (this.newCollection !== '' && this.collections.some(e => e.name === this.newCollection)) {
|
||||
if (this.newCollection !== '' && this.collections.some(e => e.name.toLowerCase() === this.newCollection.toLowerCase())) {
|
||||
return this.$t('dialog.add_to_collection.field_search_create_error').toString()
|
||||
} else return ''
|
||||
},
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ export default Vue.extend({
|
|||
},
|
||||
getErrorsName(): string {
|
||||
if (this.form.name === '') return this.$t('common.required').toString()
|
||||
if (this.form.name !== this.collection.name && this.collections.some(e => e.name === this.form.name)) {
|
||||
if (this.form.name.toLowerCase() !== this.collection.name.toLowerCase() && this.collections.some(e => e.name.toLowerCase() === this.form.name.toLowerCase())) {
|
||||
return this.$t('dialog.add_to_collection.field_search_create_error').toString()
|
||||
}
|
||||
return ''
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ export default Vue.extend({
|
|||
else return [this.books.id]
|
||||
},
|
||||
duplicate(): string {
|
||||
if (this.newReadList !== '' && this.readLists.some(e => e.name === this.newReadList)) {
|
||||
if (this.newReadList !== '' && this.readLists.some(e => e.name.toLowerCase() === this.newReadList.toLowerCase())) {
|
||||
return this.$t('dialog.add_to_readlist.field_search_create_error').toString()
|
||||
} else return ''
|
||||
},
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ export default Vue.extend({
|
|||
},
|
||||
getErrorsName(): string {
|
||||
if (this.form.name === '') return this.$t('common.required').toString()
|
||||
if (this.form.name !== this.readList.name && this.readLists.some(e => e.name === this.form.name)) {
|
||||
if (this.form.name.toLowerCase() !== this.readList.name.toLowerCase() && this.readLists.some(e => e.name.toLowerCase() === this.form.name.toLowerCase())) {
|
||||
return this.$t('dialog.add_to_readlist.field_search_create_error').toString()
|
||||
}
|
||||
return ''
|
||||
|
|
|
|||
Loading…
Reference in a new issue