Sync latest TrueGrowth updates
This commit is contained in:
@@ -35,6 +35,23 @@ const themeBridge = {
|
||||
},
|
||||
};
|
||||
|
||||
const updatesBridge = {
|
||||
getState: () => ipcRenderer.invoke('truegrowth-update:get-state'),
|
||||
check: () => ipcRenderer.invoke('truegrowth-update:check'),
|
||||
download: () => ipcRenderer.invoke('truegrowth-update:download'),
|
||||
install: () => ipcRenderer.invoke('truegrowth-update:install'),
|
||||
openChannel: () => ipcRenderer.invoke('truegrowth-update:open-channel'),
|
||||
onStateChange: (callback) => {
|
||||
if (typeof callback !== 'function') {
|
||||
return () => undefined;
|
||||
}
|
||||
const listener = (_event, state) => callback(state);
|
||||
ipcRenderer.on('truegrowth-update:state', listener);
|
||||
return () =>
|
||||
ipcRenderer.removeListener('truegrowth-update:state', listener);
|
||||
},
|
||||
};
|
||||
|
||||
contextBridge.exposeInMainWorld('trueGrowthRuntime', {
|
||||
app: 'TrueGrowth',
|
||||
platform: process.platform,
|
||||
@@ -42,6 +59,7 @@ contextBridge.exposeInMainWorld('trueGrowthRuntime', {
|
||||
localApiBaseUrl: 'http://127.0.0.1:48177/local-api',
|
||||
windowControls,
|
||||
theme: themeBridge,
|
||||
updates: updatesBridge,
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld('__OPENTU_DESKTOP__', true);
|
||||
|
||||
Reference in New Issue
Block a user