Skip to content

Commit ea3f825

Browse files
Merge branch 'develop' into node-run
2 parents ebd1eda + e1a53ef commit ea3f825

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ planned for 2025-07-01
1313

1414
### Changed
1515

16+
- [refactor] Simplify module loading process (#3766)
1617
- Use "node --run" instead of "npm run" (#1511)
1718

1819
## [2.31.0] - 2025-04-01
@@ -34,7 +35,7 @@ Thanks to: @Developer-Incoming, @eltociear, @geraki, @khassel, @KristjanESPERANT
3435

3536
### Changed
3637

37-
- [core] starting clientonly now checks for needed env var `WAYLAND_DISPLAY` or `DISPLAY` and starts electron with needed parameters (if both are set wayland is used) (#3677)
38+
- [core] Starting clientonly now checks for needed env var `WAYLAND_DISPLAY` or `DISPLAY` and starts electron with needed parameters (if both are set wayland is used) (#3677)
3839
- [core] Optimize systeminformation calls and output (#3689)
3940
- [core] Add issue templates for feature requests and bug reports (#3695)
4041
- [core] Adapt `start:x11:dev` script

js/loader.js

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -217,29 +217,22 @@ const Loader = (function () {
217217
* Load all modules as defined in the config.
218218
*/
219219
async loadModules () {
220-
let moduleData = await getModuleData();
220+
const moduleData = await getModuleData();
221221
const envVars = await getEnvVars();
222222
const customCss = envVars.customCss;
223223

224-
/**
225-
* @returns {Promise<void>} when all modules are loaded
226-
*/
227-
const loadNextModule = async function () {
228-
if (moduleData.length > 0) {
229-
const nextModule = moduleData[0];
230-
await loadModule(nextModule);
231-
moduleData = moduleData.slice(1);
232-
await loadNextModule();
233-
} else {
234-
// All modules loaded. Load custom.css
235-
// This is done after all the modules so we can
236-
// overwrite all the defined styles.
237-
await loadFile(customCss);
238-
// custom.css loaded. Start all modules.
239-
await startModules();
240-
}
241-
};
242-
await loadNextModule();
224+
// Load all modules
225+
for (const module of moduleData) {
226+
await loadModule(module);
227+
}
228+
229+
// Load custom.css
230+
// Since this happens after loading the modules,
231+
// it overwrites the default styles.
232+
await loadFile(customCss);
233+
234+
// Start all modules.
235+
await startModules();
243236
},
244237

245238
/**

0 commit comments

Comments
 (0)