forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model: Fix lots of reducers that weren't clearing data on LOGIN_SUCCESS
Most of these state subtrees hold per-account data we get from the server. In the current pre-zulip#5005 design, where we only store server data for one account, these should already have been clearing out on LOGIN_SUCCESS, like we do with messages, narrows, etc. Two of the subtrees, `outbox` and `drafts`, hold client-side per-account data. Just as with server data, we've only been keeping these around for the active account, and like the other reducers touched in this commit, we've forgotten to handle LOGIN_SUCCESS for them. So, do that. Now, all the server-data subtrees and `outbox` and `drafts` all reset on ACCOUNT_SWITCH, LOGIN_SUCCESS, and LOGOUT. That's part of Greg's proposed fix for zulip#4446. Next, we'll do the next part: > * I think it'd be a useful refactor to consolidate one action type > like `CLEAR_ACCOUNT_DATA`. > * The action creators for these three (in `accountActions.js`) can > dispatch that first, then also a `LOGOUT` etc. > * Almost all the reducers would respond only to the > `CLEAR_ACCOUNT_DATA`. > * There are a couple of exceptions, like `accountReducers` and > `sessionReducers`, that actually want to treat the three cases > differently. Those would be the only ones to continue responding > to `LOGOUT` etc.; and they'd stand out better as a result. > * Then there are further changes we might make to those, but > that'll be easier to see after that. Fixes-partly: zulip#4446
- Loading branch information
1 parent
3677788
commit 730c370
Showing
10 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters