mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Fix issues making brews when not signed in
This commit is contained in:
@@ -137,8 +137,10 @@ const EditPage = createClass({
|
||||
|
||||
toggleGoogleStorage : function(){
|
||||
this.setState((prevState)=>({
|
||||
saveGoogle : !prevState.saveGoogle
|
||||
}));
|
||||
saveGoogle : !prevState.saveGoogle,
|
||||
isSaving : false,
|
||||
errors : null
|
||||
}), ()=>this.trySave());
|
||||
},
|
||||
|
||||
save : async function(){
|
||||
|
||||
@@ -35,7 +35,7 @@ const NewPage = createClass({
|
||||
|
||||
text : '',
|
||||
isSaving : false,
|
||||
saveGoogle : (global.account.googleId ? true : false),
|
||||
saveGoogle : (global.account && global.account.googleId ? true : false),
|
||||
errors : []
|
||||
};
|
||||
},
|
||||
|
||||
@@ -96,7 +96,7 @@ app.get('/user/:username', async (req, res, next)=>{
|
||||
|
||||
let googleBrews = [];
|
||||
|
||||
if(req.account.googleId){
|
||||
if(req.account && req.account.googleId){
|
||||
console.log('GETTING DATA FOR USER PAGE');
|
||||
googleBrews = await GoogleActions.listGoogleBrews(req, res)
|
||||
.catch((err)=>{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable max-lines */
|
||||
const _ = require('lodash');
|
||||
const { google } = require('googleapis');
|
||||
const { nanoid } = require('nanoid');
|
||||
|
||||
Reference in New Issue
Block a user