fix(notifications): show the mood reminder's real default in the matrix

The /notifications matrix read the constant default table, where the
mood reminder is off, while delivery derives it from the reminder card.
An account receiving the reminder saw every one of its channel switches
off.

The no-row default now lives in one resolver that delivery and the
preferences read both use. GET /api/notifications/preferences publishes
it as `eventDefaults`, the matrix renders a switch without a stored row
from that map, and the reminder card refreshes the matrix when it flips.
This commit is contained in:
Marc-André Bombeck committed 2026-10-21 12:01:53 +02:00
1 parent 421aacf457
commit dc704b5e63
10 files changed
+487 -27

No files matched your search

+10 -3
View File
@@ -112,9 +112,16 @@ export function MoodReminderCard({
: t("notifications.moodReminder.disabledToast"),
);
setMsgType("success");
await queryClient.invalidateQueries({
queryKey: queryKeys.userProfile(),
});
await Promise.all([
queryClient.invalidateQueries({
queryKey: queryKeys.userProfile(),
}),
// The /notifications matrix shows the reminder's channel switches
// from the server's `eventDefaults`, which follow this card.
queryClient.invalidateQueries({
queryKey: queryKeys.notificationsPreferences(),
}),
]);
setOptimistic(null);
scheduleClear();
} else {