Fix adding poll options not working
This commit is contained in:
parent
a73f9771ee
commit
81cfcae433
|
@ -19,28 +19,30 @@ export default {
|
||||||
name: 'PollForm',
|
name: 'PollForm',
|
||||||
props: {
|
props: {
|
||||||
visible: {},
|
visible: {},
|
||||||
modelValue: {
|
params: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emits: ['update:modelValue'],
|
|
||||||
computed: {
|
computed: {
|
||||||
pollType: {
|
pollType: {
|
||||||
get () { return pollFallback(this.modelValue, 'pollType') },
|
get () { return pollFallback(this.params, 'pollType') },
|
||||||
set (newVal) { this.modelValue.pollType = newVal }
|
set (newVal) { this.params.pollType = newVal }
|
||||||
},
|
},
|
||||||
options: {
|
options () {
|
||||||
get () { return pollFallback(this.modelValue, 'options') },
|
const hasOptions = !!this.params.options
|
||||||
set (newVal) { this.modelValue.options = newVal }
|
if (!hasOptions) {
|
||||||
|
this.params.options = pollFallback(this.params, 'options')
|
||||||
|
}
|
||||||
|
return this.params.options
|
||||||
},
|
},
|
||||||
expiryAmount: {
|
expiryAmount: {
|
||||||
get () { return pollFallback(this.modelValue, 'expiryAmount') },
|
get () { return pollFallback(this.params, 'expiryAmount') },
|
||||||
set (newVal) { this.modelValue.expiryAmount = newVal }
|
set (newVal) { this.params.expiryAmount = newVal }
|
||||||
},
|
},
|
||||||
expiryUnit: {
|
expiryUnit: {
|
||||||
get () { return pollFallback(this.modelValue, 'expiryUnit') },
|
get () { return pollFallback(this.params, 'expiryUnit') },
|
||||||
set (newVal) { this.modelValue.expiryUnit = newVal }
|
set (newVal) { this.params.expiryUnit = newVal }
|
||||||
},
|
},
|
||||||
pollLimits () {
|
pollLimits () {
|
||||||
return this.$store.state.instance.pollLimits
|
return this.$store.state.instance.pollLimits
|
||||||
|
|
|
@ -233,7 +233,7 @@
|
||||||
v-if="pollsAvailable"
|
v-if="pollsAvailable"
|
||||||
ref="pollForm"
|
ref="pollForm"
|
||||||
:visible="pollFormVisible"
|
:visible="pollFormVisible"
|
||||||
v-model="newStatus.poll"
|
:params="newStatus.poll"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
ref="bottom"
|
ref="bottom"
|
||||||
|
|
Loading…
Reference in New Issue