Prevent letter debounce erasing when creating new answers

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-05-01 12:19:08 +02:00
parent 224cc7d6d9
commit 861b317d00
No known key found for this signature in database
GPG key ID: 60C25B8C072916CF

View file

@ -79,6 +79,10 @@ export default {
// Dispatched for creation. Marked as synced
this.answer.local = false
const newAnswer = await this.debounceCreateAnswer(answer)
// Forward changes, but use current answer.text to avoid erasing
// any in-between changes while creating the answer
Object.assign(newAnswer, { text: this.$refs.input.value })
this.$emit('update:answer', answer.id, newAnswer)
} else {
this.debounceUpdateAnswer(answer)