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