From 085034a1037a4870208661137b0e5c7c0b34a68e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 23 May 2018 12:39:04 -0400 Subject: [PATCH] store success error for page reloads --- install/web.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/install/web.js b/install/web.js index 48d2f0934f..c05f2ba849 100644 --- a/install/web.js +++ b/install/web.js @@ -36,6 +36,8 @@ var scripts = [ ]; var installing = false; +var success = false; +var error = false; web.install = function (port) { port = port || 4567; @@ -106,8 +108,8 @@ function welcome(req, res) { skipGeneralSetup: !!nconf.get('url'), databases: databases, skipDatabaseSetup: !!nconf.get('database'), - error: !!res.locals.error, - success: !!res.locals.success, + error: error, + success: success, values: req.body, minimumPasswordLength: defaults.minimumPasswordLength, installing: installing, @@ -149,11 +151,8 @@ function install(req, res) { child.on('close', function (data) { installing = false; - if (data === 0) { - res.locals.success = true; - } else { - res.locals.error = true; - } + success = data === 0; + error = data !== 0; welcome(req, res); });