From ed90f0546f8be51d7af3ada2ea1a92f806908478 Mon Sep 17 00:00:00 2001 From: Veeck Date: Thu, 26 Jan 2023 19:44:54 +0100 Subject: [PATCH] Fix async node_helper stopping electron start (#3021) Async node_helper dont have to finish immediately in loadModules. So the start callback in the app.js with the config isnt called for some time. But the electron ready event can already be fired in the meantime. This lead to the electron app starting but without a config (which is provded by the node_helper callback) therefor crashing. This PR fixes #2487 by moving the callback call out of the loadModules block, therefor the config is provided in time. If any new async node_helper doesnt like this, we will see it :-) Co-authored-by: veeck --- CHANGELOG.md | 3 ++- js/app.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ef5c18..b3d7f249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,8 @@ _This release is scheduled to be released on 2023-04-01._ - Fix message display with HTML code into alert module (#2828) - Fix typo into french translation - Yr wind direction is no longer inverted -- The wind direction arrow now points in the direction the wind is flowing, not into the wind. +- Fix async node_helper stopping electron start (#2487) +- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019) ## [2.22.0] - 2023-01-01 diff --git a/js/app.js b/js/app.js index 293551f1..2f9e0b49 100644 --- a/js/app.js +++ b/js/app.js @@ -257,11 +257,12 @@ function App() { }); Log.log("Sockets connected & modules started ..."); - if (typeof callback === "function") { - callback(config); - } }); }); + + if (typeof callback === "function") { + callback(config); + } }); };