Hide the expiry date indication if the poll never expires

Signed-off-by: SyoBoN <syobon@syobon.net>
This commit is contained in:
SyoBoN 2024-01-26 17:43:43 +09:00
parent 9042792133
commit 062323c0d5
No known key found for this signature in database
GPG Key ID: 38DBCFD11F41319A
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -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 }) }}&nbsp;·&nbsp;
{{ $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 }) }}&nbsp;·&nbsp;
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }}
</template>
<span v-if="expiresAt !== null">
&nbsp;·&nbsp;
</span>
</div>
<span>
<span v-if="expiresAt !== null">
<i18n-t
scope="global"
:keypath="expired ? 'polls.expired' : 'polls.expires_in'"