mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
refactor(main): extract app lifecycle dependency wiring helper
This commit is contained in:
26
src/main.ts
26
src/main.ts
@@ -651,7 +651,19 @@ const startupState = runStartupBootstrapRuntimeService({
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
startAppLifecycle: (args) => {
|
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,
|
app,
|
||||||
platform: process.platform,
|
platform: process.platform,
|
||||||
shouldStartApp: (nextArgs) => shouldStartApp(nextArgs),
|
shouldStartApp: (nextArgs) => shouldStartApp(nextArgs),
|
||||||
@@ -755,16 +767,8 @@ const startupState = runStartupBootstrapRuntimeService({
|
|||||||
updateVisibleOverlayVisibility();
|
updateVisibleOverlayVisibility();
|
||||||
updateInvisibleOverlayVisibility();
|
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(
|
function handleCliCommand(
|
||||||
args: CliArgs,
|
args: CliArgs,
|
||||||
|
|||||||
Reference in New Issue
Block a user