commit: 23edfe7b918844f8cc2ff5b9b245952092ee1cbf
parent 698d6085918c012150a16ffaf24d34970629542d
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date: Fri, 22 Mar 2024 08:17:33 +0000
Merge branch 'non-expiring-polls' into 'develop'
Hide the expiry date indication if the poll never expires
Closes #961
See merge request pleroma/pleroma-fe!1889
Diffstat:
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/changelog.d/non-expiring-polls-indication.fix b/changelog.d/non-expiring-polls-indication.fix
@@ -0,0 +1 @@
+The expiry date indication won't be shown if the poll never expires
diff --git a/src/components/poll/poll.js b/src/components/poll/poll.js
@@ -38,7 +38,7 @@ export default {
return (this.poll && this.poll.options) || []
},
expiresAt () {
- return (this.poll && this.poll.expires_at) || 0
+ return (this.poll && this.poll.expires_at) || null
},
expired () {
return (this.poll && this.poll.expired) || false
diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue
@@ -75,13 +75,16 @@
</button>
<div class="total">
<template v-if="typeof poll.voters_count === 'number'">
- {{ $tc("polls.people_voted_count", poll.voters_count, { count: poll.voters_count }) }} ·
+ {{ $tc("polls.people_voted_count", poll.voters_count, { count: poll.voters_count }) }}
</template>
<template v-else>
- {{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }} ·
+ {{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }}
</template>
+ <span v-if="expiresAt !== null">
+ ·
+ </span>
</div>
- <span>
+ <span v-if="expiresAt !== null">
<i18n-t
scope="global"
:keypath="expired ? 'polls.expired' : 'polls.expires_in'"