diff --git a/src/js/components/Facebook/Main.js b/src/js/components/Facebook/Main.js index 1e3a8bc5d..ee112c251 100644 --- a/src/js/components/Facebook/Main.js +++ b/src/js/components/Facebook/Main.js @@ -25,7 +25,7 @@ class Main extends React.Component { componentDidMount () { FacebookActionCreators.initFacebook(); - this.changeListener = this._onFacebookChange(); + this.changeListener = this._onFacebookChange.bind(this); FacebookStore.addChangeListener(this.changeListener); } diff --git a/src/js/routes/More/SignIn.jsx b/src/js/routes/More/SignIn.jsx index e277e9750..99c004c2a 100755 --- a/src/js/routes/More/SignIn.jsx +++ b/src/js/routes/More/SignIn.jsx @@ -41,17 +41,18 @@ export default class SignIn extends Component { }); FacebookActionCreators.initFacebook(); - FacebookStore.addChangeListener(() => this._onFacebookChange()); - + this.changeListener = this._onFacebookChange.bind(this); + FacebookStore.addChangeListener(this.changeListener); + this.voterListener = this._onVoterStoreChange.bind(this); // console.log("SignIn componentDidMount VoterStore.addChangeListener"); - VoterStore.addChangeListener(this._onVoterStoreChange.bind(this)); + VoterStore.addChangeListener(this.voterListener); } componentWillUnmount () { - FacebookStore.removeChangeListener(this._onFacebookChange); + FacebookStore.removeChangeListener(this.changeListener); // console.log("SignIn componentWillUnmount VoterStore.removeChangeListener"); - VoterStore.removeChangeListener(this._onVoterStoreChange.bind(this)); + VoterStore.removeChangeListener(this.voterListener); } _onVoterStoreChange () {