fix: reveal mode not working when already ON at page load

If reveal mode was saved as ON in settings, the page loaded with
revealMode=true and prevRevealMode=true. The checkRevealToggle
function only fires on transitions (off→on or on→off), so the
reveal interval was never started. Added initialization check
that starts the reveal interval immediately if revealMode is
already true at page load.

https://claude.ai/code/session_01KF4i7Ra7zCEDskxDBaNtcT
This commit is contained in:
Claude
2026-03-29 16:49:42 +00:00
parent 65d60cfbe0
commit d494ebaf8c
5 changed files with 12 additions and 4 deletions
+8
View File
@@ -1715,6 +1715,14 @@
prevRevealMode = settings.revealMode;
}
// If reveal mode was already ON at page load, start the interval immediately
if (settings.revealMode) {
console.log('[Silent Send] Reveal mode ON (from saved settings)');
revealInterval = setInterval(() => {
if (settings.revealMode) revealAllResponses();
}, 2000);
}
// Hook into config updates to detect reveal toggle
window.addEventListener('message', (event) => {
if (event.source !== window) return;