Skip to content

Commit

Permalink
FIX: spam notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Diebbo committed Jan 7, 2025
1 parent b841f07 commit 75ab886
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions server/src/pushNotificationWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,6 @@ export default function createNotificationWorker(db) {
continue;
}

// send notifications for user
if (user?.inbox?.length > 0) {
while (user.inbox.length > 0) {
const notification = user.inbox[0];
try {
await sendNotification(user, notification);
user.inbox.shift();
} catch (error) {
console.error(
`Error sending notification to user ${user.username}:`,
error,
);
// Continue with next notification
}
}
}

for (const event of user.events || []) {
if (!event?.notification) {
console.log(
Expand Down

0 comments on commit 75ab886

Please sign in to comment.