diff --git a/client/src/lib/types.ts b/client/src/lib/types.ts index bd16839..77a8cd2 100644 --- a/client/src/lib/types.ts +++ b/client/src/lib/types.ts @@ -199,6 +199,7 @@ interface Preview { } interface GetPreferencesResponse { + notifications_disabled: boolean; individual_preference: EventPreferences; preview: Preview; templates: TemplateVariables; diff --git a/client/src/routes/calendar/+page.svelte b/client/src/routes/calendar/+page.svelte index c2d0a67..62b912f 100644 --- a/client/src/routes/calendar/+page.svelte +++ b/client/src/routes/calendar/+page.svelte @@ -31,6 +31,7 @@ let templates: TemplateVariables | undefined = $derived(currentEventPrefs?.templates); let resolved: ResolvedData | undefined = $derived(currentEventPrefs?.resolved); let editMode = $state(false); + let notificationsDisabled = $state(false); let titleTemplates = [ "{% if schedule_type == 'Laboratory' %}{{title | remove: '- Lab'}} - {{schedule_type_short}}{% else %}{{title}}{% endif %}", @@ -643,6 +644,7 @@ location_template: string; reminder_settings: ReminderSettings[]; color_id: string; + notifications_disabled: boolean; }> = {}; const titleChanged = editTitle !== (resolved?.title_template ?? titleTemplates[0]); @@ -680,6 +682,8 @@ event_preference.reminder_settings = convertedNotifications; } + event_preference.notifications_disabled = notificationsDisabled; + if (Object.keys(event_preference).length === 0) { activeCourse = undefined; activeMeeting = undefined; @@ -908,6 +912,7 @@ editDescriptionManual = currentEventPrefs.preview?.description ?? ""; editLocationManual = currentEventPrefs.preview?.location ?? ""; courseColor = resolved?.color_id ?? "#d50000"; + notificationsDisabled = currentEventPrefs.notifications_disabled ?? false; if (resolved?.reminder_settings && resolved.reminder_settings.length > 0) { //@ts-ignore @@ -1157,17 +1162,34 @@ {/if}
+ Reminders are muted. Your settings are preserved but notifications are currently disabled. Re-enable notifications in Settings to activate them. +
+ {/if} {#each notifications, i} -