mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
Restore the old "a grain opens straight into its board" behaviour as a convenience, WITHOUT persisting anything. On the Sandstorm home route only: - a saved Home board (explicitly chosen by the user) always wins -> redirect; - else, once the boards subscription has loaded, exactly ONE board -> just open it (nothing is saved); - else (zero or many boards, no chosen Home board) -> stay on All Boards. Choosing a Home board stays a separate, explicit action (the All Boards home toggle, #2220) — the auto-open never writes it. The redirect is reactive (Tracker.autorun over a boards subscription), so it waits out Sandstorm asynchronous grain login (Meteor.userId lands late) and board loading instead of firing once too early. Runs at most once per page load, and only when isSandstorm. - models/lib/sandstormAutoOpen.js: pure, unit-tested decideSandstormAutoOpen() (+ tests/sandstormAutoOpen.test.cjs, wired into test:unit:node). - config/router.js: startSandstormAutoOpen() reactive redirect, gated to Sandstorm; non-Sandstorm keeps the existing one-shot default-board redirect.