Email reminder bell: re-evaluate visibility live on settings change

The bell is already gated on settings.reminder_channel === 'email', but
the check only ran at email-library init — so switching the reminder
channel in Settings didn't update the bell until you reopened Email.

- Settings/Reminders channel-change handler now dispatches
  odysseus-reminder-channel-changed { channel } after saving.
- emailLibrary listens for it and re-runs _syncEmailReminderBellVisibility
  with the new channel value.
This commit is contained in:
pewdiepie-archdaemon
2026-06-10 23:26:53 +09:00
parent 031a600725
commit f4c1b264c6
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -2645,6 +2645,9 @@ async function initReminderSettings() {
if (hint) hint.textContent = CHANNEL_HINTS[channelSel.value] || '';
syncChannelRows();
save({ reminder_channel: channelSel.value });
// Email reminder bell visibility tracks this — broadcast so the
// email library can re-evaluate without waiting for a re-open.
try { window.dispatchEvent(new CustomEvent('odysseus-reminder-channel-changed', { detail: { channel: channelSel.value } })); } catch (_) {}
});
if (emailToIn) {
let emailDebounce;