This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 832
Reset store state when logging out #930
Merged
ara4n
merged 5 commits into
new-guest-access
from
luke/new-guest-access-reset-stores-on-logged-out
May 26, 2017
Merged
Reset store state when logging out #930
ara4n
merged 5 commits into
new-guest-access
from
luke/new-guest-access-reset-stores-on-logged-out
May 26, 2017
Conversation
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 prevents RoomView from doing any peeking whilst the join/registration is in progress, causing weirdness with TimelinePanel getPendingEventList (which throws an error if called when peeking).
These must now make a dispatch to RoomViewStore instead of calling `viewRoom` directly on MatrixChat. This will call both `viewRoom` of MatrixChat _and_ the logic in RVS so there is some redundancy here. It'd be best to move as much as possible of viewRoom out to the RVS itself. But for now, this fixes a bug that occures when leaving (the viewed room would not change).
This prevents leaking of state that we do not want to share with the next user
14 tasks
ara4n
reviewed
May 26, 2017
src/stores/LifecycleStore.js
Outdated
@@ -61,6 +61,11 @@ class LifecycleStore extends Store { | |||
}); | |||
dis.dispatch(deferredAction); | |||
break; | |||
case 'on_logged_out': | |||
this._state = { | |||
deferred_action: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this duplication feels pretty ming and fragile, surely we should use the same pattern as RoomViewStore and have an INITIAL_STATE variable which gets copied over the top of this._state.
ara4n
reviewed
May 26, 2017
src/stores/SessionStore.js
Outdated
@@ -66,6 +66,11 @@ class SessionStore extends Store { | |||
cachedPassword: null, | |||
}); | |||
break; | |||
case 'on_logged_out': | |||
this._state = { | |||
cachedPassword: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this duplication feels pretty ming and fragile, surely we should use the same pattern as RoomViewStore and have an INITIAL_STATE variable which gets copied over the top of this._state.
a minor quibble - back atcha |
lgtm |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prevents leaking of state that we do not want to share with the next user