`loadAll` captured `weekStart` in a stale closure when called via `setTimeout`. Selecting a date would show the correct value in the input but load data for the previously-shown week. Replaced all deferred `setTimeout(() => loadAll(true), 0)` calls with direct `loadAll(true, newDate)` calls, passing the updated date as an explicit argument. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 line
No EOL
156 B
JavaScript
1 line
No EOL
156 B
JavaScript
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/hk-planner/sw.js', { scope: '/hk-planner/' })})} |