Skip to content

Commit

Permalink
Merge branch 'develop-build' of github.com:Diebbo/proj-tw202425 into …
Browse files Browse the repository at this point in the history
…develop-build
  • Loading branch information
SuperMitic committed Jan 7, 2025
2 parents bd7a2c7 + 60c71a5 commit eb760d7
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
1 change: 0 additions & 1 deletion client/components/calendar/calendar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//client/components/calendar/calendar.tsx
"use client";

import { Chip, Button, Tooltip, Switch } from "@nextui-org/react";
Expand Down
2 changes: 1 addition & 1 deletion client/components/calendar/eventAdder.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import React, { useState, useEffect, ReactElement } from "react";
import React, { useState, useEffect } from "react";
import { areIntervalsOverlapping, parseISO } from "date-fns";
import { Interval } from "date-fns";
import {
Expand Down
4 changes: 2 additions & 2 deletions client/components/calendar/showEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,8 @@ const ShowEvent: React.FC<ShowEventProps> = ({

<DatePicker
defaultValue={getDateParsed(
displayEvent.dtstart,
displayEvent.allDay,
displayEvent.notification.fromDate,
displayEvent.notification.repetition.freq === 'minutley',
)}
maxValue={getDateParsed(
displayEvent.dtstart,
Expand Down
Binary file added client/public/song/21stschizoidman.mp3
Binary file not shown.
21 changes: 2 additions & 19 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 Expand Up @@ -208,7 +191,7 @@ export default function createNotificationWorker(db) {
from: "selfie.notification@gmail.com",
to: payload.email,
subject: payload.title,
text: payload.body,
html: payload.body,
};

if (process.env.NODE_ENV !== "production") {
Expand Down Expand Up @@ -264,7 +247,7 @@ export default function createNotificationWorker(db) {
const emailPayload = {
email: user.email,
title: payload.title,
body: `${payload.body}\n\n<a href="http://site232454.tw.cs.unibo/${payload.link}>Click here to view</a>`,
body: `${payload.body}\n\n<a href="https://site232454.tw.cs.unibo.it/${payload.link}">Click here to view</a>`,
};

await sendEmailNotification(emailPayload);
Expand Down

0 comments on commit eb760d7

Please sign in to comment.