store success error for page reloads

v1.18.x
Barış Soner Uşaklı 7 years ago
parent c2f088cb61
commit 085034a103

@ -36,6 +36,8 @@ var scripts = [
]; ];
var installing = false; var installing = false;
var success = false;
var error = false;
web.install = function (port) { web.install = function (port) {
port = port || 4567; port = port || 4567;
@ -106,8 +108,8 @@ function welcome(req, res) {
skipGeneralSetup: !!nconf.get('url'), skipGeneralSetup: !!nconf.get('url'),
databases: databases, databases: databases,
skipDatabaseSetup: !!nconf.get('database'), skipDatabaseSetup: !!nconf.get('database'),
error: !!res.locals.error, error: error,
success: !!res.locals.success, success: success,
values: req.body, values: req.body,
minimumPasswordLength: defaults.minimumPasswordLength, minimumPasswordLength: defaults.minimumPasswordLength,
installing: installing, installing: installing,
@ -149,11 +151,8 @@ function install(req, res) {
child.on('close', function (data) { child.on('close', function (data) {
installing = false; installing = false;
if (data === 0) { success = data === 0;
res.locals.success = true; error = data !== 0;
} else {
res.locals.error = true;
}
welcome(req, res); welcome(req, res);
}); });

Loading…
Cancel
Save