mirror of
https://github.com/gotson/komga.git
synced 2026-05-07 20:15:47 +02:00
fix(webui): add debouncer when searching for author in Edit Book dialog
Closes: #960
This commit is contained in:
parent
59e6517488
commit
da3d283503
1 changed files with 3 additions and 2 deletions
|
|
@ -412,6 +412,7 @@ import {helpers, requiredIf} from 'vuelidate/lib/validators'
|
||||||
import {BookDto, BookThumbnailDto} from '@/types/komga-books'
|
import {BookDto, BookThumbnailDto} from '@/types/komga-books'
|
||||||
import IsbnVerify from '@saekitominaga/isbn-verify'
|
import IsbnVerify from '@saekitominaga/isbn-verify'
|
||||||
import {isMatch} from 'date-fns'
|
import {isMatch} from 'date-fns'
|
||||||
|
import {debounce} from 'lodash'
|
||||||
import {ERROR, ErrorEvent} from '@/types/events'
|
import {ERROR, ErrorEvent} from '@/types/events'
|
||||||
import DropZone from '@/components/DropZone.vue'
|
import DropZone from '@/components/DropZone.vue'
|
||||||
import ThumbnailCard from '@/components/ThumbnailCard.vue'
|
import ThumbnailCard from '@/components/ThumbnailCard.vue'
|
||||||
|
|
@ -488,10 +489,10 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
authorSearch: {
|
authorSearch: {
|
||||||
deep: true,
|
deep: true,
|
||||||
async handler(val: []) {
|
handler: debounce(async function (this: any, val: []) {
|
||||||
const index = val.findIndex(x => x !== null)
|
const index = val.findIndex(x => x !== null)
|
||||||
this.authorSearchResults = await this.$komgaReferential.getAuthorsNames(val[index])
|
this.authorSearchResults = await this.$komgaReferential.getAuthorsNames(val[index])
|
||||||
},
|
}, 500),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
validations: {
|
validations: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue