fix(notifications): include baby name in all push/browser notification titles and bodies
This commit is contained in:
@@ -510,9 +510,9 @@ export default function DashboardPage() {
|
||||
|
||||
useEffect(() => {
|
||||
const lastFeed = events.find((e) => e.type === "BREASTFEED" || e.type === "BOTTLE");
|
||||
checkFeedAlert(lastFeed ? new Date(lastFeed.startedAt) : null, getThresholds());
|
||||
checkFeedAlert(lastFeed ? new Date(lastFeed.startedAt) : null, getThresholds(), baby?.name);
|
||||
const id = setInterval(() => {
|
||||
checkFeedAlert(lastFeed ? new Date(lastFeed.startedAt) : null, getThresholds());
|
||||
checkFeedAlert(lastFeed ? new Date(lastFeed.startedAt) : null, getThresholds(), baby?.name);
|
||||
}, 5 * 60 * 1000);
|
||||
return () => clearInterval(id);
|
||||
}, [events]);
|
||||
|
||||
@@ -73,7 +73,7 @@ export async function POST(req: Request) {
|
||||
const message = [`🥛 Stock lait — ${babyName}`, "", ...lines].join("\n");
|
||||
for (const user of users) {
|
||||
if (user.pushoverUserKey) {
|
||||
await sendPushover(user.pushoverUserKey, message, `🥛 Alerte stock lait`);
|
||||
await sendPushover(user.pushoverUserKey, message, `🥛 Lait — ${babyName}`);
|
||||
sent++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function POST() {
|
||||
const message = `Rappel médicament : ${reminder.name}${dosePart} pour ${reminder.baby.name}`;
|
||||
|
||||
try {
|
||||
await notifyFamilyFeedAlert(reminder.baby.familyId, message);
|
||||
await notifyFamilyFeedAlert(reminder.baby.familyId, message, `💊 ${reminder.name} — ${reminder.baby.name}`);
|
||||
await prisma.medicationReminder.update({
|
||||
where: { id: reminder.id },
|
||||
data: { lastSentAt: now },
|
||||
|
||||
Reference in New Issue
Block a user