Fix new posts check not working

This commit is contained in:
Lim Chee Aun 2022-12-22 08:39:01 +08:00
parent c828f53f09
commit 6c0aedcd3e

View file

@ -85,12 +85,15 @@ function Home({ hidden }) {
setUIState('loading'); setUIState('loading');
setTimeout(() => { setTimeout(() => {
(async () => { (async () => {
const newStatus = await masto.timelines.fetchHome({ const newStatuses = await masto.timelines.fetchHome({
limit: 2, limit: 2,
// Need 2 because "new posts" only appear when there are 2 or more // Need 2 because "new posts" only appear when there are 2 or more
}); });
if (newStatus.length && newStatus[0].id !== states.home[0].id) { if (
states.homeNew = newStatus; newStatuses.value.length &&
newStatuses.value[0].id !== states.home[0].id
) {
states.homeNew = newStatuses.value;
} }
setUIState('default'); setUIState('default');
})(); })();