mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-23 00:41:36 +00:00
fix(desktop): restart GitNexus server on macOS activate when all windows closed
On macOS, if the backend process crashes while all windows are closed, createWindow() on the next dock-click loaded the embedded UI against a dead server — resulting in a silent blank page with no error dialog. Call ensureGitNexusServerStarted() before createWindow() in the activate handler so the server is restarted (or verified healthy) before the window attempts to load content.
This commit is contained in:
parent
170a625438
commit
4b3fe8058a
1 changed files with 10 additions and 4 deletions
|
|
@ -304,6 +304,10 @@ const spawnGitNexusServer = (): ChildProcess => {
|
|||
appendGitNexusServerOutput(getErrorMessage(error));
|
||||
});
|
||||
|
||||
childProcess.once('exit', () => {
|
||||
serverReadyPromise = null;
|
||||
});
|
||||
|
||||
return childProcess;
|
||||
};
|
||||
|
||||
|
|
@ -805,10 +809,12 @@ app.whenReady().then(async () => {
|
|||
|
||||
app.on('activate', () => {
|
||||
if (openWindows.size === 0) {
|
||||
void createWindow().catch((error) => {
|
||||
showStartupError(error);
|
||||
exitStartupFailure();
|
||||
});
|
||||
void ensureGitNexusServerStarted()
|
||||
.then(() => createWindow())
|
||||
.catch((error) => {
|
||||
showStartupError(error);
|
||||
exitStartupFailure();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue