Support infinite voting time for remote polls

Signed-off-by: Marcin Mikołajczak <git@mkljczk.pl>
This commit is contained in:
Marcin Mikołajczak 2023-11-05 14:46:05 +01:00
parent ded13132ff
commit bf3c6f4822
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ const PollFooter: React.FC<IPollFooter> = ({ poll, showResults, selected }): JSX
{votesCount}
</Text>
{poll.expires_at && (
{poll.expires_at !== null && (
<>
<Text theme='muted'>&middot;</Text>
<Text weight='medium' theme='muted' data-testid='poll-expiration'>{timeRemaining}</Text>

View File

@ -14,7 +14,7 @@ const pollOptionSchema = z.object({
const pollSchema = z.object({
emojis: filteredArray(customEmojiSchema),
expired: z.boolean().catch(false),
expires_at: z.string().datetime().catch(new Date().toUTCString()),
expires_at: z.string().datetime().nullable().catch(null),
id: z.string(),
multiple: z.boolean().catch(false),
options: z.array(pollOptionSchema).min(2),