commit
4e50f227d8
|
@ -1030,19 +1030,18 @@ function Status({
|
||||||
onClick={replyStatus}
|
onClick={replyStatus}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{canBoost && (
|
<div class="action has-count">
|
||||||
<div class="action has-count">
|
<StatusButton
|
||||||
<StatusButton
|
checked={reblogged}
|
||||||
checked={reblogged}
|
title={['Boost', 'Unboost']}
|
||||||
title={['Boost', 'Unboost']}
|
alt={['Boost', 'Boosted']}
|
||||||
alt={['Boost', 'Boosted']}
|
class="reblog-button"
|
||||||
class="reblog-button"
|
icon="rocket"
|
||||||
icon="rocket"
|
count={reblogsCount}
|
||||||
count={reblogsCount}
|
onClick={boostStatus}
|
||||||
onClick={boostStatus}
|
disabled={!canBoost}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
|
||||||
<div class="action has-count">
|
<div class="action has-count">
|
||||||
<StatusButton
|
<StatusButton
|
||||||
checked={favourited}
|
checked={favourited}
|
||||||
|
@ -1280,24 +1279,26 @@ function Poll({
|
||||||
const expiresAtDate = !!expiresAt && new Date(expiresAt);
|
const expiresAtDate = !!expiresAt && new Date(expiresAt);
|
||||||
|
|
||||||
// Update poll at point of expiry
|
// Update poll at point of expiry
|
||||||
useEffect(() => {
|
// NOTE: Disable this because setTimeout runs immediately if delay is too large
|
||||||
let timeout;
|
// https://stackoverflow.com/a/56718027/20838
|
||||||
if (!expired && expiresAtDate) {
|
// useEffect(() => {
|
||||||
const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer
|
// let timeout;
|
||||||
if (ms > 0) {
|
// if (!expired && expiresAtDate) {
|
||||||
timeout = setTimeout(() => {
|
// const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer
|
||||||
setUIState('loading');
|
// if (ms > 0) {
|
||||||
(async () => {
|
// timeout = setTimeout(() => {
|
||||||
await refresh();
|
// setUIState('loading');
|
||||||
setUIState('default');
|
// (async () => {
|
||||||
})();
|
// // await refresh();
|
||||||
}, ms);
|
// setUIState('default');
|
||||||
}
|
// })();
|
||||||
}
|
// }, ms);
|
||||||
return () => {
|
// }
|
||||||
clearTimeout(timeout);
|
// }
|
||||||
};
|
// return () => {
|
||||||
}, [expired, expiresAtDate]);
|
// clearTimeout(timeout);
|
||||||
|
// };
|
||||||
|
// }, [expired, expiresAtDate]);
|
||||||
|
|
||||||
const pollVotesCount = votersCount || votesCount;
|
const pollVotesCount = votersCount || votesCount;
|
||||||
let roundPrecision = 0;
|
let roundPrecision = 0;
|
||||||
|
|
Loading…
Reference in a new issue