mirror of
https://github.com/Pandipipas/scoreko-electron-dev.git
synced 2026-06-06 05:32:06 +00:00
Add human-style explanatory comments in main runtime flow
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user