Archived
Electron forge migration (#2)
Reviewed-on: https://git.internal.vyntehome.com/vynte/vynte-connect/pulls/2
This commit was merged in pull request #2.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// See the Electron documentation for details on how to use preload scripts:
|
||||
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
|
||||
|
||||
import { contextBridge, ipcRenderer } from "electron";
|
||||
|
||||
contextBridge.exposeInMainWorld('vynte', {
|
||||
getStatus: () => ipcRenderer.invoke('status:get'),
|
||||
refresh: () => ipcRenderer.invoke('status:refresh'),
|
||||
connect: () => ipcRenderer.invoke('vpn:connect'),
|
||||
disconnect: () => ipcRenderer.invoke('vpn:disconnect'),
|
||||
logout: () => ipcRenderer.invoke('vpn:logout'),
|
||||
toggleAuto: () => ipcRenderer.invoke('auto:toggle'),
|
||||
quit: () => ipcRenderer.invoke('app:quit'),
|
||||
openGateway: () => ipcRenderer.invoke('external:openGateway'),
|
||||
onStatus: (callback: Function) => ipcRenderer.on('status', (_, status) => callback(status))
|
||||
})
|
||||
Reference in New Issue
Block a user