Make loading new posts less destructive

pull/10/head
Lim Chee Aun 2022-12-18 11:53:41 +08:00
rodzic 16ae8af889
commit 03b319a517
1 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -83,8 +83,16 @@ function Home({ hidden }) {
if (diffMins > 1) { if (diffMins > 1) {
console.log('visible', { lastHidden, diffMins }); console.log('visible', { lastHidden, diffMins });
setTimeout(() => { setTimeout(() => {
loadStatuses(true); (async () => {
states.homeNew = []; const newStatus = await masto.timelines.fetchHome({
limit: 1,
});
if (newStatus.length && newStatus[0].id !== states.home[0].id) {
states.homeNew = newStatus;
}
})();
// loadStatuses(true);
// states.homeNew = [];
}, 100); }, 100);
} }
} }