client: link to update vote count
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/lint-backend Pipeline failed Details
ci/woodpecker/push/test Pipeline failed Details

This commit is contained in:
Johann150 2024-01-03 17:41:20 +01:00
parent 24f6177b94
commit 86565cd25b
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 10 additions and 0 deletions

View File

@ -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>