Преглед на файлове

Fix an issue where polls with 'expires_at' not set expired (#12222)

master^2
Takeshi Umeda преди 4 години
committed by Eugen Rochko
родител
ревизия
5b46467474
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. +2
    -1
      app/javascript/mastodon/components/poll.js

+ 2
- 1
app/javascript/mastodon/components/poll.js Целия файл

@@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent {

static getDerivedStateFromProps (props, state) {
const { poll, intl } = props;
const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now();
const expires_at = poll.get('expires_at');
const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now();
return (expired === state.expired) ? null : { expired };
}



Зареждане…
Отказ
Запис