mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 06:22:43 +00:00
Determine default state and set in local storage
This commit is contained in:
@@ -34,10 +34,12 @@ const AccountPage = createClass({
|
|||||||
componentDidMount : function(){
|
componentDidMount : function(){
|
||||||
if(!this.state.saveLocation && this.props.uiItems.username) {
|
if(!this.state.saveLocation && this.props.uiItems.username) {
|
||||||
SAVEKEY = `HOMEBREWERY-DEFAULT-SAVE-LOCATION-${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 == '') {
|
if(saveLocation == '') {
|
||||||
// TO DO: Implement logic to determine the appropriate location given current state
|
saveLocation = 'HOMEBREWERY';
|
||||||
console.log(this.state.uiItems);
|
if(this.state.uiItems.googleId) {
|
||||||
|
saveLocation = 'GOOGLE-DRIVE';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
this.setState({
|
this.setState({
|
||||||
saveLocation : saveLocation
|
saveLocation : saveLocation
|
||||||
|
|||||||
Reference in New Issue
Block a user