diff --git a/src/components/MainCommand.js b/src/components/MainCommand.js index 6549faf..cc2e209 100644 --- a/src/components/MainCommand.js +++ b/src/components/MainCommand.js @@ -17,7 +17,9 @@ const INITIAL_COMMAND_STATE = { : 'https://s3-us-west-1.amazonaws.com/charify-assets/defaultLogo.png', commandInputPlaceholder: 'Do Everything You Want', commandComplete: false, - commandProcessedData: null + commandProcessedData: null, + + needGoogleAuth: false }; class MainCommand extends Component { @@ -94,6 +96,7 @@ class MainCommand extends Component { var newCommandInputPlaceholder = this.state.commandInputPlaceholder; var newCommandComplete = this.state.commandComplete; var newCommandProcessedData = this.state.commandProcessedData; + var newNeedGoogleAuth = this.state.needGoogleAuth; // initial finding that command was entered // TODO: helper function to properly change properties @@ -103,6 +106,7 @@ class MainCommand extends Component { 'https://image.flaticon.com/icons/png/512/281/281769.png'; newInput = newInput.replace('gmail', ''); newCommandInputPlaceholder = 'to | subject | message'; + newNeedGoogleAuth = true; } if (newCommand == 'google') { @@ -129,6 +133,11 @@ class MainCommand extends Component { } } + if (newNeedGoogleAuth) { + // Make the user go through google sign in + this.googleSignIn(); + } + this.setState({ command: newCommand, commandInput: newInput, @@ -196,8 +205,11 @@ class MainCommand extends Component { return (