login: Support logging out of an account
Screenshots coming soon. :)
Fixes: #463
This implements the logic where per-account routes on the nav are removed on logout, but it doesn't animate their exits; they just disappear suddenly. I think that's probably fine, and I didn't find a way to add the animation in.
To test a scenario where there are per-account routes when the logout happens, you can add a button to the "under construction" screen and copy-paste _logOutAccount into its press handler.
Marked as a draft because in particular I think this may be lacking some test coverage that we'll want; for example, of the various if (maybeAccount == null) return;s added in PerAccountStore. But in that example, at least, I'm not sure if there might be a nicer way to write the app code. I added those early returns to avoid having ApiConnection.send get called after the ApiConnection was closed, which is a goal, as I think we discussed in the office on Friday.
Thanks for the review! Revision pushed.
Thanks for the review! Revision pushed.
Do the screenshots need to be updated for this one?
Do the screenshots need to be updated for this one?
Ah right! Actually the UI hasn't changed from what's shown in the screenshots in the PR description. I remember us talking in the office about making it look better, but I don't remember if we settled on something different. If there are changes to make, how about doing them as a followup?
In the interest of getting things merged efficiently, maybe let's split this PR up
Sounds good. I just sent #1007 for those first several commits, and I'll send a followup with the remaining ones (implementing logout) as a followup. Then as mentioned in my previous comment, maybe any UI changes can be a followup to that.