fix(background): one closing pattern

This commit is contained in:
Alexey Kasyanchuk
2018-08-03 15:23:25 +03:00
parent 28c07fc689
commit 0f450d3133

View File

@ -300,17 +300,18 @@ const stop = () => {
{ {
spider.stop(() => sphinx.stop()) spider.stop(() => sphinx.stop())
} }
else else if(sphinx)
{ {
sphinx.stop() sphinx.stop()
} }
else
{
app.quit()
}
} }
app.on("window-all-closed", () => { app.on("window-all-closed", () => {
if (sphinx) stop()
stop()
else
app.quit()
}); });
app.on('before-quit', () => { app.on('before-quit', () => {
@ -318,8 +319,7 @@ app.on('before-quit', () => {
rl.close() rl.close()
app.isQuiting = true app.isQuiting = true
if (sphinx) stop()
stop()
}) })
var rl = require("readline").createInterface({ var rl = require("readline").createInterface({
@ -332,8 +332,5 @@ rl.on("SIGINT", function () {
}); });
process.on("SIGINT", () => { process.on("SIGINT", () => {
if (sphinx) stop()
stop()
else
app.quit()
}); });