From 808d56432e650248798be0fe74dc1d0759f84ef3 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 29 Dec 2022 10:45:47 +0800 Subject: [PATCH] Use sinceId for new checks --- src/app.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.jsx b/src/app.jsx index adf5578f..c2548ccb 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -121,11 +121,15 @@ function startVisibility() { // Buffer for WS reconnect (async () => { try { + const firstStatusID = states.home[0]?.id; + const firstNotificationID = states.notifications[0]?.id; const fetchHome = masto.v1.timelines.listHome({ limit: 1, + ...(firstStatusID && { sinceId: firstStatusID }), }); const fetchNotifications = masto.v1.notifications.list({ limit: 1, + ...(firstNotificationID && { sinceId: firstNotificationID }), }); const newStatuses = await fetchHome;