From bae81f8d392ee265a78bb6f7597f4067266852b1 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 5 Apr 2023 23:36:52 -0400 Subject: [PATCH] Fix poll duration unit --- src/components/poll/poll_form.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/poll/poll_form.js b/src/components/poll/poll_form.js index a533e2b8..032b3695 100644 --- a/src/components/poll/poll_form.js +++ b/src/components/poll/poll_form.js @@ -28,19 +28,19 @@ export default { computed: { pollType: { get () { return pollFallback(this.modelValue, 'pollType') }, - set (newVal) { this.$emit('update:modelValue', { ...this.modelValue, pollType: newVal }) } + set (newVal) { this.modelValue.pollType = newVal } }, options: { get () { return pollFallback(this.modelValue, 'options') }, - set (newVal) { this.$emit('update:modelValue', { ...this.modelValue, options: newVal }) } + set (newVal) { this.modelValue.options = newVal } }, expiryAmount: { get () { return pollFallback(this.modelValue, 'expiryAmount') }, - set (newVal) { this.$emit('update:modelValue', { ...this.modelValue, expiryAmount: newVal }) } + set (newVal) { this.modelValue.expiryAmount = newVal } }, expiryUnit: { get () { return pollFallback(this.modelValue, 'expiryUnit') }, - set (newVal) { this.$emit('update:modelValue', { ...this.modelValue, expiryUnit: newVal }) } + set (newVal) { this.modelValue.expiryUnit = newVal } }, pollLimits () { return this.$store.state.instance.pollLimits @@ -98,7 +98,7 @@ export default { }, addOption () { if (this.options.length < this.maxOptions) { - this.options = [...this.options, ''] + this.options.push('') return true } return false @@ -106,7 +106,6 @@ export default { deleteOption (index, event) { if (this.options.length > 2) { this.options.splice(index, 1) - this.options = [...this.options] } }, convertExpiryToUnit (unit, amount) {