Fix adding/removing poll options

This commit is contained in:
tusooa 2023-04-05 22:56:39 -04:00
parent 3c39269be8
commit d884082761
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
1 changed files with 2 additions and 5 deletions

View File

@ -98,7 +98,7 @@ export default {
}, },
addOption () { addOption () {
if (this.options.length < this.maxOptions) { if (this.options.length < this.maxOptions) {
this.options.push('') this.options = [...this.options, '']
return true return true
} }
return false return false
@ -106,7 +106,7 @@ export default {
deleteOption (index, event) { deleteOption (index, event) {
if (this.options.length > 2) { if (this.options.length > 2) {
this.options.splice(index, 1) this.options.splice(index, 1)
this.updatePollToParent() this.options = [...this.options]
} }
}, },
convertExpiryToUnit (unit, amount) { convertExpiryToUnit (unit, amount) {
@ -121,9 +121,6 @@ export default {
Math.max(this.minExpirationInCurrentUnit, this.expiryAmount) Math.max(this.minExpirationInCurrentUnit, this.expiryAmount)
this.expiryAmount = this.expiryAmount =
Math.min(this.maxExpirationInCurrentUnit, this.expiryAmount) Math.min(this.maxExpirationInCurrentUnit, this.expiryAmount)
this.updatePollToParent()
},
updatePollToParent () {
} }
} }
} }