Make loading new posts less destructive

This commit is contained in:
Lim Chee Aun 2022-12-18 11:53:41 +08:00
parent 16ae8af889
commit 03b319a517

View file

@ -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);
} }
} }