forked from FoundKeyGang/FoundKey
client: link to update vote count
This commit is contained in:
parent
24f6177b94
commit
86565cd25b
1 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,8 @@
|
|||
<p v-if="!readOnly">
|
||||
<span>{{ i18n.t('_poll.totalVotes', { n: total }) }}</span>
|
||||
<span> · </span>
|
||||
<a @click="update()">{{ i18n.ts.reload }}</a>
|
||||
<span> · </span>
|
||||
<a v-if="!closed && !isVoted" @click="showResult = !showResult">{{ showResult ? i18n.ts._poll.vote : i18n.ts._poll.showResult }}</a>
|
||||
<span v-if="isVoted">{{ i18n.ts._poll.voted }}</span>
|
||||
<span v-else-if="closed">{{ i18n.ts._poll.closed }}</span>
|
||||
|
@ -84,6 +86,14 @@ const vote = async (id) => {
|
|||
});
|
||||
if (!showResult.value) showResult.value = !props.note.poll.multiple;
|
||||
};
|
||||
|
||||
const update = async () => {
|
||||
pleaseLoginOrRemote(urlForNote(props.note));
|
||||
|
||||
await os.apiWithDialog('notes/polls/update', {
|
||||
noteId: props.note.id,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in a new issue