From 64a361e06c2986cce99fe2c689e98a71c3f270de Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 19 Jul 2023 20:36:55 +1200 Subject: [PATCH] Determine default state and set in local storage --- client/homebrew/pages/accountPage/accountPage.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index b19b0f47a..ad6bcdb61 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -34,10 +34,12 @@ const AccountPage = createClass({ componentDidMount : function(){ if(!this.state.saveLocation && this.props.uiItems.username) { SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${this.props.uiItems.username}`; - const saveLocation = window.localStorage.getItem(SAVEKEY) || ''; + let saveLocation = window.localStorage.getItem(SAVEKEY) || ''; if(saveLocation == '') { - // TO DO: Implement logic to determine the appropriate location given current state - console.log(this.state.uiItems); + saveLocation = 'HOMEBREWERY'; + if(this.state.uiItems.googleId) { + saveLocation = 'GOOGLE-DRIVE'; + } }; this.setState({ saveLocation : saveLocation