Skip to content

Commit 3281dbc

Browse files
committed
fix(pv): poll locking in voting interface
the previous implementation used either in separate cases, causing some features to appear locked but not others (upon lock update) unify use of v.pollCopy.locked, replacing v.pollLocked in all cases
1 parent 7bcc7da commit 3281dbc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/posts/PollViewer.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<div class="poll-title">
55
<span class="poll-title-text">
66
Poll
7-
<span class="is_locked" v-if="pollLocked">(Locked)</span>
7+
<span class="is_locked" v-if="pollCopy.locked">(Locked)</span>
88
</span>
99
<div class="poll-controls">
1010
<!-- Poll Controls -->
1111
<!-- TODO(boka): data-balloon="Lock Poll" data-balloon-pos="down" -->
12-
<div class="poll-control" v-if="canLock()" :class="{'is_locked' : pollLocked}">
13-
<input id="lockPoll" class="icon" type="checkbox" v-model="pollLocked">
12+
<div class="poll-control" v-if="canLock()" :class="{'is_locked' : pollCopy.locked}">
13+
<input id="lockPoll" class="icon" type="checkbox" v-model="pollCopy.locked">
1414
<label for="lockPoll" @click="updateLockPoll()">
1515
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
1616
<title></title>
@@ -209,7 +209,7 @@ export default {
209209
console.log('PollViewer removeVote')
210210
}
211211
const updateLockPoll = () => {
212-
if(v.pollLocked) {
212+
if(v.pollCopy.locked) {
213213
pollsApi.unlock(props.thread.id, props.poll.id)
214214
}
215215
else {
@@ -256,7 +256,6 @@ export default {
256256
},
257257
editPoll: false,
258258
pollAnswers: [],
259-
pollLocked: props.poll.locked,
260259
pollCopy: cloneDeep(props.poll)
261260
})
262261
/* Data Initialization */

0 commit comments

Comments
 (0)