fix(gui): fix potencial false window load
This commit is contained in:
parent
d2ad3be4d5
commit
94218b7b74
@ -152,14 +152,6 @@ app.on("ready", () => {
|
||||
dbPatcher(() => {
|
||||
changeLanguage(appConfig.language, () => setApplicationMenu())
|
||||
|
||||
mainWindow.loadURL(
|
||||
url.format({
|
||||
pathname: path.join(__dirname, "app.html"),
|
||||
protocol: "file:",
|
||||
slashes: true
|
||||
})
|
||||
);
|
||||
|
||||
if (env.name === "development") {
|
||||
mainWindow.openDevTools();
|
||||
}
|
||||
@ -240,6 +232,17 @@ app.on("ready", () => {
|
||||
callback.apply(null, arg)
|
||||
})
|
||||
}, app.getPath("userData"), app.getVersion(), env.name)
|
||||
|
||||
// load page only after init app
|
||||
spider.initialized.then(() => {
|
||||
mainWindow.loadURL(
|
||||
url.format({
|
||||
pathname: path.join(__dirname, "app.html"),
|
||||
protocol: "file:",
|
||||
slashes: true
|
||||
})
|
||||
);
|
||||
})
|
||||
}, mainWindow, sphinx)
|
||||
}, app.getPath("userData"), () => app.quit())
|
||||
});
|
||||
|
@ -35,6 +35,8 @@ const torrentClient = require('./torrentClient')
|
||||
//console.log('Listening web server on', config.httpPort, 'port')
|
||||
|
||||
module.exports = function (send, recive, dataDirectory, version, env)
|
||||
{
|
||||
this.initialized = (async () =>
|
||||
{
|
||||
|
||||
let torrentsId = 1;
|
||||
@ -721,7 +723,7 @@ setInterval(() => {
|
||||
// load inside api
|
||||
|
||||
// setup api
|
||||
API({
|
||||
await API({
|
||||
sphinx,
|
||||
recive,
|
||||
send,
|
||||
@ -839,6 +841,6 @@ setInterval(() => {
|
||||
}))
|
||||
})
|
||||
}
|
||||
return this
|
||||
|
||||
})()
|
||||
}
|
Loading…
Reference in New Issue
Block a user