fix: wrap HTTP_SERVER_GET_STATUS response in IpcResult envelope
The HTTP_SERVER_GET_STATUS handler returned a raw { running, port } object
while all other HTTP server handlers (start, stop) return { success, data }.
invokeIpcWithResult() in the preload expects the IpcResult<T> envelope and
treats a missing success field as failure, throwing 'Unknown error'.
This caused an unhandled promise rejection every time the Settings page
opened, because GeneralSection calls api.httpServer.getStatus() on mount.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
39d88e22a4
commit
8d652c4d2e
1 changed files with 1 additions and 1 deletions
|
|
@ -310,7 +310,7 @@ function initializeServices(): void {
|
|||
});
|
||||
|
||||
ipcMain.handle(HTTP_SERVER_GET_STATUS, () => {
|
||||
return { running: httpServer.isRunning(), port: httpServer.getPort() };
|
||||
return { success: true, data: { running: httpServer.isRunning(), port: httpServer.getPort() } };
|
||||
});
|
||||
|
||||
// Forward SSH state changes to renderer and HTTP SSE clients
|
||||
|
|
|
|||
Loading…
Reference in a new issue