SessionStore extends flux.Store

This commit is contained in:
Luke Barnard 2017-05-15 14:52:19 +01:00
parent 2b4c87aca6
commit da3cb0ee48
3 changed files with 19 additions and 14 deletions

View file

@ -68,15 +68,15 @@ module.exports = React.createClass({
},
componentWillMount: function() {
this.sessionStore = sessionStore;
this.sessionStore.on('update', this.setStateFromSessionStore);
this._sessionStore = sessionStore;
this._sessionStore.addListener(this._setStateFromSessionStore);
this.setStateFromSessionStore();
this._setStateFromSessionStore();
},
setStateFromSessionStore: function() {
_setStateFromSessionStore: function() {
this.setState({
cachedPassword: this.sessionStore.getCachedPassword(),
cachedPassword: this._sessionStore.getCachedPassword(),
});
},