From 9c574503303c0eb66190fe9676261d449f36bf5d Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Sat, 22 Jan 2022 00:18:13 +0300 Subject: [PATCH] [NFC] Explicitly define variables before using them Fixed two errors which were discovered by trying to run the code in "strict" mode, which is automatically done by Jest testing framework. --- server/app.js | 3 ++- server/googleActions.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/app.js b/server/app.js index c36533b9b..db2eaac5f 100644 --- a/server/app.js +++ b/server/app.js @@ -261,7 +261,8 @@ app.use((req, res)=>{ account : req.account, enable_v3 : config.get('enable_v3') }; - templateFn('homebrew', title = req.brew ? req.brew.title : '', props) + const title = req.brew ? req.brew.title : ''; + templateFn('homebrew', title, props) .then((page)=>{ res.send(page); }) .catch((err)=>{ console.log(err); diff --git a/server/googleActions.js b/server/googleActions.js index 0050cb81d..d780dc4ac 100644 --- a/server/googleActions.js +++ b/server/googleActions.js @@ -11,7 +11,7 @@ const config = require('nconf') //let oAuth2Client; -GoogleActions = { +const GoogleActions = { authCheck : (account, res)=>{ if(!account || !account.googleId){ // If not signed into Google