Merge pull request #327 from nextcloud/fix/new-answer-debounce

This commit is contained in:
John Molakvoæ 2020-05-01 13:59:31 +02:00 коммит произвёл GitHub
Родитель 6df6596c23 861b317d00
Коммит 5151a46b9f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -79,6 +79,10 @@ export default {
// Dispatched for creation. Marked as synced // Dispatched for creation. Marked as synced
this.answer.local = false this.answer.local = false
const newAnswer = await this.debounceCreateAnswer(answer) 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) this.$emit('update:answer', answer.id, newAnswer)
} else { } else {
this.debounceUpdateAnswer(answer) this.debounceUpdateAnswer(answer)