maybe fix duplicate notification response issue

This commit is contained in:
2025-07-05 01:15:40 +00:00
parent d85acd2179
commit 9ee3663890

View File

@ -188,6 +188,7 @@ const deleteNotification = async (notification: Notification) => {
);
if (!response.ok) {
console.error(`Could not delete notification ID: ${notification.id}`);
console.error(response.statusText);
}
} catch (error: any) {
throw new Error(error.message);
@ -198,8 +199,8 @@ const fetchInterval = process.env.FETCH_INTERVAL
? parseInt(process.env.FETCH_INTERVAL)
: 15000;
let notifications = [];
const beginFetchCycle = async () => {
let notifications = [];
setInterval(async () => {
notifications = await getNotifications();
if (notifications.length > 0) {