We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7512f3a commit 5b46467Copy full SHA for 5b46467
1 file changed
app/javascript/mastodon/components/poll.js
@@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent {
39
40
static getDerivedStateFromProps (props, state) {
41
const { poll, intl } = props;
42
- const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now();
+ const expires_at = poll.get('expires_at');
43
+ const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now();
44
return (expired === state.expired) ? null : { expired };
45
}
46
0 commit comments