From ff9b474f4a21965a9da1aef25594a8b5b706c778 Mon Sep 17 00:00:00 2001 From: Jonas Rittershofer Date: Sun, 17 May 2020 13:38:34 +0200 Subject: [PATCH] Fix saving options on fast proceed Signed-off-by: Jonas Rittershofer --- src/components/Questions/AnswerInput.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Questions/AnswerInput.vue b/src/components/Questions/AnswerInput.vue index 6e28b9c..4068127 100644 --- a/src/components/Questions/AnswerInput.vue +++ b/src/components/Questions/AnswerInput.vue @@ -59,6 +59,11 @@ export default { data() { return { queue: new PQueue({ concurrency: 1 }), + + // As data instead of Method, to have a separate debounce per AnswerInput + debounceUpdateAnswer: pDebounce(function(answer) { + return this.queue.add(() => this.updateAnswer(answer)) + }, 500), } }, @@ -179,9 +184,6 @@ export default { console.error(error) } }, - debounceUpdateAnswer: pDebounce(function(answer) { - return this.queue.add(() => this.updateAnswer(answer)) - }, 500), }, }