Implement server management enhancements with window close handling

- Introduced a checkbox in the ConnectionForm to allow users to keep the server running when the app closes.
- Added a setupWindowCloseHandler function to manage server shutdown based on user preference.
- Updated App component to integrate the new window close handling logic.
- Created a reusable Checkbox component for better UI consistency.
- Modified serverStore to include state management for the new setting.
This commit is contained in:
Jamie Pine
2026-01-25 12:13:35 -08:00
parent 9b7ee21e6c
commit 7b1e2295ef
6 changed files with 172 additions and 8 deletions
+7
View File
@@ -10,6 +10,9 @@ interface ServerStore {
mode: 'local' | 'remote';
setMode: (mode: 'local' | 'remote') => void;
keepServerRunningOnClose: boolean;
setKeepServerRunningOnClose: (keepRunning: boolean) => void;
}
export const useServerStore = create<ServerStore>()(
@@ -23,6 +26,10 @@ export const useServerStore = create<ServerStore>()(
mode: 'local',
setMode: (mode) => set({ mode }),
keepServerRunningOnClose: false,
setKeepServerRunningOnClose: (keepRunning) =>
set({ keepServerRunningOnClose: keepRunning }),
}),
{
name: 'voicebox-server',