mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:29:37 +08:00
* feat(desktop): sync Windows menu preferences with web settings * fix(settings): reconcile desktop preferences after updating the live baseline * fix(desktop): guard menu zoom handlers against missing web view
11 lines
552 B
JavaScript
11 lines
552 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron');
|
|
contextBridge.exposeInMainWorld('desktop', {
|
|
platform: process.platform,
|
|
initialStatus: () => ipcRenderer.sendSync('desktop:status-sync'),
|
|
status: () => ipcRenderer.invoke('desktop:status'),
|
|
restart: () => ipcRenderer.invoke('desktop:restart'),
|
|
logs: () => ipcRenderer.invoke('desktop:logs'),
|
|
popupMenu: (id, position) => ipcRenderer.invoke('desktop:popupMenu', id, position),
|
|
onStatus: callback => { ipcRenderer.on('desktop:status', (_event, state) => callback(state)); },
|
|
});
|