Add human-style explanatory comments in main runtime flow

This commit is contained in:
Pandipipas
2026-02-24 00:52:08 +01:00
parent fddf32905a
commit fd4a599ae0
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -31,6 +31,7 @@ let loadingWindow: BrowserWindow | null = null;
let shutdownState: AppShutdownState = "running";
async function launchApplication(): Promise<void> {
// We create both windows early so startup feels instant while NodeCG is booting in the background.
mainWindow = createMainWindow({ appConfig, rootPath, mainDashboardUrl });
loadingWindow = createLoadingWindow({ appConfig, rootPath });
@@ -53,6 +54,7 @@ async function launchApplication(): Promise<void> {
await mainWindow.loadURL(mainDashboardUrl);
// Keep the loading overlay visible for a minimum amount of time to avoid abrupt flashes.
const remainingLoadingDelay = getRemainingDelayMs(appConfig.loadDelayMs, loadingShownAt);
if (remainingLoadingDelay > 0) {
await sleep(remainingLoadingDelay);
@@ -126,6 +128,7 @@ app.on("before-quit", (event) => {
return;
}
// Block the default quit flow until we ask NodeCG to stop cleanly.
event.preventDefault();
stopNodecgGracefully().finally(() => {