diff --git a/packages/client/actions/authSignUpNSignIn.js b/packages/client/actions/authSignUpNSignIn.js index ee0cc25..d8a33bf 100644 --- a/packages/client/actions/authSignUpNSignIn.js +++ b/packages/client/actions/authSignUpNSignIn.js @@ -14,7 +14,6 @@ export default function authSignUpNSignIn(presets) { type: SET_PRESET, payload: res.data.presets, }); - return Promise.resolve(); } catch({ response }) { console.log(response.data.error); } diff --git a/packages/client/containers/App.jsx b/packages/client/containers/App.jsx index b82db88..de5496b 100644 --- a/packages/client/containers/App.jsx +++ b/packages/client/containers/App.jsx @@ -44,16 +44,15 @@ class App extends Component { window.addEventListener('message', this.onReceiveMessage); } - componentWillReceiveProps() { + async componentWillReceiveProps() { const token = localStorage.getItem('token'); // Sign in upon receiving user token if (!this.state.signIn && token) { - this.props.authSignUpNSignIn(this.props.presets).then(() => { - // Set sign in flag after received the preset data - this.setState({ - signIn: true, - showSignInDialog: false, - }); + await this.props.authSignUpNSignIn(this.props.presets); + // Set sign in flag after received the preset data + this.setState({ + signIn: true, + showSignInDialog: false, }); } }