Skip to content

Commit

Permalink
fix(webui): add debouncer when searching for author in Edit Book dialog
Browse files Browse the repository at this point in the history
Closes: #960
  • Loading branch information
noaione authored Oct 30, 2022
1 parent 59e6517 commit da3d283
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions komga-webui/src/components/dialogs/EditBooksDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ import {helpers, requiredIf} from 'vuelidate/lib/validators'
import {BookDto, BookThumbnailDto} from '@/types/komga-books'
import IsbnVerify from '@saekitominaga/isbn-verify'
import {isMatch} from 'date-fns'
import {debounce} from 'lodash'
import {ERROR, ErrorEvent} from '@/types/events'
import DropZone from '@/components/DropZone.vue'
import ThumbnailCard from '@/components/ThumbnailCard.vue'
Expand Down Expand Up @@ -488,10 +489,10 @@ export default Vue.extend({
},
authorSearch: {
deep: true,
async handler(val: []) {
handler: debounce(async function (this: any, val: []) {
const index = val.findIndex(x => x !== null)
this.authorSearchResults = await this.$komgaReferential.getAuthorsNames(val[index])
},
}, 500),
},
},
validations: {
Expand Down

0 comments on commit da3d283

Please sign in to comment.