Fix: Standardize Electron bridge and implement robust caching
- Refactored all IPC methods and parameters to snake_case for consistency with SvelteKit. - Implemented exhaustive background caching engine with download locking. - Reverted to legacy-proven flat hash storage pattern (hash.file). - Added axios for reliable stream-based binary downloads. - Updated preload and main handlers to support recursive room data fetching.
This commit is contained in:
@@ -1,8 +1,18 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
|
||||
contextBridge.exposeInMainWorld('aetherNative', {
|
||||
getSeedConfig: () => ipcRenderer.invoke('get-seed-config'),
|
||||
getDeviceConfig: () => ipcRenderer.invoke('get-device-config'),
|
||||
getJWT: () => ipcRenderer.invoke('get-jwt'),
|
||||
get_seed_config: () => ipcRenderer.invoke('get-seed-config'),
|
||||
get_device_config: () => ipcRenderer.invoke('get-device-config'),
|
||||
get_jwt: () => ipcRenderer.invoke('get-jwt'),
|
||||
log: (message: string) => console.log('[Native Log]', message),
|
||||
|
||||
// Shell Handlers
|
||||
open_folder: (path: string) => ipcRenderer.invoke('native:open-folder', path),
|
||||
run_command: (args: any) => ipcRenderer.invoke('native:run-cmd', args),
|
||||
launch_file: (path: string) => ipcRenderer.invoke('native:launch-file', path),
|
||||
|
||||
// File/Cache Handlers
|
||||
check_cache: (args: any) => ipcRenderer.invoke('native:check-cache', args),
|
||||
download_to_cache: (args: any) => ipcRenderer.invoke('native:download-to-cache', args),
|
||||
launch_from_cache: (args: any) => ipcRenderer.invoke('native:launch-from-cache', args),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user