Use sinceId for new checks

This commit is contained in:
Lim Chee Aun 2022-12-29 10:45:47 +08:00
parent 353c911232
commit 808d56432e

View file

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