Integrate session management, multilingual IPC handlers, and Book database operations

- Add `LocalSystem` with handlers for session retrieval (`userId`, `lang`) and error handling.
- Extend IPC handlers to support multilingual operations (`fr`, `en`) and session data injection
This commit is contained in:
natreex
2025-11-18 19:51:17 -05:00
parent 5a891a72ff
commit d46aecc80d
5 changed files with 874 additions and 2 deletions

View File

@@ -9,8 +9,12 @@ contextBridge.exposeInMainWorld('electron', {
setToken: (token: string) => ipcRenderer.invoke('set-token', token),
removeToken: () => ipcRenderer.invoke('remove-token'),
// Language management
getLang: () => ipcRenderer.invoke('get-lang'),
setLang: (lang: 'fr' | 'en') => ipcRenderer.invoke('set-lang', lang),
// Auth events
loginSuccess: (token: string) => ipcRenderer.send('login-success', token),
loginSuccess: (token: string, userId: string) => ipcRenderer.send('login-success', token, userId),
logout: () => ipcRenderer.send('logout'),
// Database operations