Your daily reminder needs three states, not a boolean
I built a checklist that opens itself at 8 am. The hard part wasn't opening it. It was working out when to stop. The version that fails The obvious model is a boolean. One flag per day: { " 2026-09-20 " : { opened : false } } A timer checks every thirty seconds. Is it past 8am, and is opened still false? Show the window. When the person presses Start My Day , set it true and go quiet until…
The author describes building a checklist application that opens automatically at 8 am, but the real challenge was determining when to stop displaying the window. Initially, the author tried using a boolean flag to track whether the window had been opened or dismissed. However, this approach proved insufficient, as simply closing the window did not clear the flag, causing the window to reopen repeatedly.
The author eventually discovered that the key to resolving this issue lay in introducing a third state, alongside 'opened' and 'dismissed', which represents a window that has been answered but not yet closed. By adopting this three-state approach, the checklist app could more accurately reflect the user's actions and avoid unnecessary reopenings.
Additionally, the author highlights how this change simplifies the timer logic, as it can now focus on checking whether a slot has been settled or dismissed instead of dealing with various workarounds. The author emphasizes that a boolean flag alone is insufficient for accurately tracking user interaction and that the correct question to ask is whether the user has actually engaged with the window, regardless of whether they've completed the task or simply closed it.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.