Implement SessionStore

This wraps session-related state into a basic flux store. The localStorage item 'mx_pass' is the only thing managed by this store for now but it could easily be extended to track other items (like the teamToken which is passed around through props a lot)
This commit is contained in:
Luke Barnard 2017-05-12 12:02:45 +01:00
parent 8725ef3863
commit 1176573f39
6 changed files with 104 additions and 32 deletions

View file

@ -139,9 +139,6 @@ module.exports = React.createClass({
// Team token for the referral link. If falsy, the referral section will
// not appear
teamToken: React.PropTypes.string,
// the user is a PWLU (/w password stashed in localStorage 'mx_pass')
cachedPassword: React.PropTypes.string,
},
getDefaultProps: function() {
@ -898,7 +895,6 @@ module.exports = React.createClass({
rowLabelClassName="mx_UserSettings_profileLabelCell"
rowInputClassName="mx_UserSettings_profileInputCell"
buttonClassName="mx_UserSettings_button mx_UserSettings_changePasswordButton"
cachedPassword={this.props.cachedPassword}
onError={this.onPasswordChangeError}
onFinished={this.onPasswordChanged} />
);