Back from a group returns to your own mail (#133) #137

Merged
jcoffey-dev merged 1 commits from fix/back-to-main-account into main 2026-11-20 22:47:41 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 0361c853e0 Back from a group returns to your own mail (#133)
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m7s
ci / announce (pull_request) Skipped
The account in view isn't part of the address, so after #129 an account
switch replaced the page and left nothing to go back to: in the installed
app, Back from a group closed the app.

Each page the app puts in the history now carries the account it was
showing (history.state, written in the router's aroundNav, which every
link, redirect and navigate() passes through). A switch pushes a page
again, and Back or Forward onto a page that showed another account
switches to it; from a group, Back goes to your own mail first, then out
of the app. A page with no mark, such as the one the app opened on, is
your own account; one whose account is gone since falls back to it.
While a message is being written the account stays, as for the switch
in the menu.

The listener goes in when lib/accountHistory loads, ahead of the
router's: listeners on window run in the order they were added (checked
in Chromium; capture doesn't change it), and the account has to change
before the new address renders, or the mail view looks up one account's
folder in the other's list and says it no longer exists.

Reported on the forum (t/232, post 40).

Fixes #133
2026-11-20 15:45:23 -07:00