maybe fix duplicate notification response issue
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user