diff --git a/lib/modules/webserver/server.js b/lib/modules/webserver/server.js index 97e00e8d..6a0d54fe 100644 --- a/lib/modules/webserver/server.js +++ b/lib/modules/webserver/server.js @@ -32,11 +32,11 @@ class Server { async.waterfall([ function createPlaceholderPage(next) { - if (self.isFirstStart) { - self.isFirstStart = false; - return self.events.request('build-placeholder', next); + if (!self.isFirstStart) { + return next(); } - next(); + self.isFirstStart = false; + self.events.request('build-placeholder', next); }, function listen(next) { self.server.listen(self.port, self.hostname, () => { @@ -45,12 +45,9 @@ class Server { }); }, function openBrowser(next) { - if (!self.opened) { - self.opened = true; - return self.events.request('open-browser', next); + if (self.opened) { + return next(); } - next(); - }, function reportAvailable(next) { next(null, __("webserver available at") + " " + diff --git a/lib/pipeline/pipeline.js b/lib/pipeline/pipeline.js index fea9fa1b..cbb27c40 100644 --- a/lib/pipeline/pipeline.js +++ b/lib/pipeline/pipeline.js @@ -29,11 +29,11 @@ class Pipeline { async.waterfall([ function createPlaceholderPage(next){ - if (!self.isFirstBuild) { - return self.events.request('build-placeholder', next); + if (self.isFirstBuild) { + self.isFirstBuild = false; + return next(); } - self.isFirstBuild = false; - next(); + self.events.request('build-placeholder', next); }, function buildTheContracts(next) { self.buildContracts(next);