Support infinite voting time for remote polls
Signed-off-by: Marcin Mikołajczak <git@mkljczk.pl> Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
committed by
marcin mikołajczak
parent
ded13132ff
commit
3406ce043c
@ -33,9 +33,11 @@ const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
const timeRemaining = poll.expired ?
|
||||
intl.formatMessage(messages.closed) :
|
||||
<RelativeTimestamp weight='medium' timestamp={poll.expires_at} futureDate />;
|
||||
const timeRemaining = poll.expires_at && (
|
||||
poll.expired ?
|
||||
intl.formatMessage(messages.closed) :
|
||||
<RelativeTimestamp weight='medium' timestamp={poll.expires_at} futureDate />
|
||||
);
|
||||
|
||||
let votesCount = null;
|
||||
|
||||
@ -82,7 +84,7 @@ const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX
|
||||
{votesCount}
|
||||
</Text>
|
||||
|
||||
{poll.expires_at && (
|
||||
{poll.expires_at !== null && (
|
||||
<>
|
||||
<Text theme='muted'>·</Text>
|
||||
<Text weight='medium' theme='muted' data-testid='poll-expiration'>{timeRemaining}</Text>
|
||||
|
||||
Reference in New Issue
Block a user