mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-18 14:20:42 -07:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user