refactor(main): extract app lifecycle dependency wiring helper

This commit is contained in:
2026-02-14 01:17:39 -08:00
parent 94c1b131ef
commit c5f4ffebe5

View File

@@ -651,7 +651,19 @@ const startupState = runStartupBootstrapRuntimeService({
return true;
},
startAppLifecycle: (args) => {
startAppLifecycleService(args, createAppLifecycleDepsRuntimeService({
startAppLifecycleService(args, createAppLifecycleDepsRuntimeService(createAppLifecycleRuntimeDeps()));
},
});
appState.initialArgs = startupState.initialArgs;
appState.mpvSocketPath = startupState.mpvSocketPath;
appState.texthookerPort = startupState.texthookerPort;
appState.backendOverride = startupState.backendOverride;
appState.autoStartOverlay = startupState.autoStartOverlay;
appState.texthookerOnlyMode = startupState.texthookerOnlyMode;
function createAppLifecycleRuntimeDeps() {
return {
app,
platform: process.platform,
shouldStartApp: (nextArgs) => shouldStartApp(nextArgs),
@@ -755,16 +767,8 @@ const startupState = runStartupBootstrapRuntimeService({
updateVisibleOverlayVisibility();
updateInvisibleOverlayVisibility();
},
}));
},
});
appState.initialArgs = startupState.initialArgs;
appState.mpvSocketPath = startupState.mpvSocketPath;
appState.texthookerPort = startupState.texthookerPort;
appState.backendOverride = startupState.backendOverride;
appState.autoStartOverlay = startupState.autoStartOverlay;
appState.texthookerOnlyMode = startupState.texthookerOnlyMode;
};
}
function handleCliCommand(
args: CliArgs,