Sync latest TrueGrowth updates
Some checks failed
CI / main (push) Has been cancelled
CI / release-e2e (push) Has been cancelled

This commit is contained in:
jiam
2026-07-08 02:03:18 +08:00
parent 52636c91ae
commit 5119ac0ef8
102 changed files with 20985 additions and 1760 deletions

View File

@@ -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);