From 6c0aedcd3ebc32220eb5732e6869129c38fbb399 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 22 Dec 2022 08:39:01 +0800 Subject: [PATCH] Fix new posts check not working --- src/pages/home.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/home.jsx b/src/pages/home.jsx index 8edd4bfa..13756d1c 100644 --- a/src/pages/home.jsx +++ b/src/pages/home.jsx @@ -85,12 +85,15 @@ function Home({ hidden }) { setUIState('loading'); setTimeout(() => { (async () => { - const newStatus = await masto.timelines.fetchHome({ + const newStatuses = await masto.timelines.fetchHome({ limit: 2, // Need 2 because "new posts" only appear when there are 2 or more }); - if (newStatus.length && newStatus[0].id !== states.home[0].id) { - states.homeNew = newStatus; + if ( + newStatuses.value.length && + newStatuses.value[0].id !== states.home[0].id + ) { + states.homeNew = newStatuses.value; } setUIState('default'); })();