diff options
| author | SyoBoN <syobon@syobon.net> | 2024-01-26 17:43:43 +0900 |
|---|---|---|
| committer | SyoBoN <syobon@syobon.net> | 2024-01-26 17:57:00 +0900 |
| commit | 062323c0d5459ffc3575e1fed33bda439ab630ce (patch) | |
| tree | d02688406c8573e157f08418985e5a08a8bb19de /src | |
| parent | 90427921336879bd7b5df742a7af41d85dceeee4 (diff) | |
Hide the expiry date indication if the poll never expires
Signed-off-by: SyoBoN <syobon@syobon.net>
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/poll/poll.js | 2 | ||||
| -rw-r--r-- | src/components/poll/poll.vue | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/components/poll/poll.js b/src/components/poll/poll.js index f6001f56..9ce0e29e 100644 --- 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 index b3a74c49..f7e16665 100644 --- 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'" |
