mirror of
https://github.com/gotson/komga.git
synced 2025-01-09 04:08:00 +08:00
fix(webui): search for collection/readlist in the "add to" dialog should ignore accents
Closes: #944
This commit is contained in:
parent
834ed0e964
commit
ac67924fba
@ -76,6 +76,7 @@
|
||||
import Vue from 'vue'
|
||||
import {SeriesDto} from '@/types/komga-series'
|
||||
import {ERROR} from '@/types/events'
|
||||
import {stripAccents} from '@/functions/string'
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'CollectionAddToDialog',
|
||||
@ -120,7 +121,7 @@ export default Vue.extend({
|
||||
} else return ''
|
||||
},
|
||||
collectionsFiltered(): CollectionDto[] {
|
||||
return this.collections.filter((x: CollectionDto) => x.name.toLowerCase().includes(this.newCollection.toLowerCase()))
|
||||
return this.collections.filter((x: CollectionDto) => stripAccents(x.name.toLowerCase()).includes(stripAccents(this.newCollection.toLowerCase())))
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -77,6 +77,7 @@
|
||||
import Vue from 'vue'
|
||||
import {BookDto} from '@/types/komga-books'
|
||||
import {ERROR} from '@/types/events'
|
||||
import {stripAccents} from '@/functions/string'
|
||||
|
||||
export default Vue.extend({
|
||||
name: 'ReadListAddToDialog',
|
||||
@ -121,7 +122,7 @@ export default Vue.extend({
|
||||
} else return ''
|
||||
},
|
||||
readListsFiltered(): ReadListDto[] {
|
||||
return this.readLists.filter((x: ReadListDto) => x.name.toLowerCase().includes(this.newReadList.toLowerCase()))
|
||||
return this.readLists.filter((x: ReadListDto) => stripAccents(x.name.toLowerCase()).includes(stripAccents(this.newReadList.toLowerCase())))
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
3
komga-webui/src/functions/string.ts
Normal file
3
komga-webui/src/functions/string.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export function stripAccents(s: string): string {
|
||||
return s.normalize('NFD').replace(/\p{Diacritic}/gu, '')
|
||||
}
|
Loading…
Reference in New Issue
Block a user