Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix settings resetting on refresh #404

Merged
merged 1 commit into from
Aug 10, 2016
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Aug 10, 2016

Don't clear localstorage when replacing the client: we clear it when logging out so this is just redundant, and since we now use replaceClient to unpickle a session from localstorage, this was blowing away all our setting on every refresh.

Also Move all of the localstorage code to Lifecycle (except device ID but this will probably be generated on the server soon anyway). We previously cleared localstorage on logout in Lifecycle so persist the session in Lifecycle.setLoggedIn() to be symmetrical.

Fixes element-hq/element-web#1940

Don't clear localstorage when replacing the client: we clear it when logging out so this is just redundant, and since we now use replaceClient to unpickle a session from localstorage, this was blowing away all our setting on every refresh.

Also Move all of the localstorage code to Lifecycle (except device ID but this will probably be generated on the server soon anyway). We previously cleared localstorage on logout in Lifecycle so persist the session in Lifecycle.setLoggedIn() to be symmetrical.
@richvdh richvdh merged commit bb3a0ff into develop Aug 10, 2016
richvdh added a commit that referenced this pull request Aug 10, 2016
#404 messed this up
somewhat; hopefully this gets it right
richvdh added a commit to element-hq/element-web that referenced this pull request Aug 11, 2016
1. Check that localstorage is correctly updated on successful login (test for
   matrix-org/matrix-react-sdk#404)

2. Check that the saved HS isused for guest registration (test for
   matrix-org/matrix-react-sdk#405)

3. Test loginToken handling (test for
   matrix-org/matrix-react-sdk#406 /
   #1946)
@richvdh richvdh deleted the dbkr/fix_settings_persistence branch February 15, 2017 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants