-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreload.js
26 lines (24 loc) · 1.55 KB
/
preload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { ipcRenderer, contextBridge } = require('electron');
contextBridge.exposeInMainWorld('electron', {
authenticate: () => ipcRenderer.invoke('authorize-google'),
saveOAuthCredentials: () => ipcRenderer.invoke('save-credentials'),
resetCredentials: () => ipcRenderer.invoke('reset-credentials'),
checkCredentials: () => ipcRenderer.invoke('checkCredentials'),
checkToken: () => ipcRenderer.invoke('checkToken'),
getSheetInfo: (link) => ipcRenderer.invoke('getSheetInfo', { link }),
openLink: () => ipcRenderer.send('open-link'),
openWalletLink: (address) => ipcRenderer.invoke('open-wallet-link', { address }),
saveApiCredentials: (credentials) => ipcRenderer.invoke('save-api-credentials', credentials),
getApiCredentials: () => ipcRenderer.invoke('get-api-credentials'),
resetApiCredentials: () => ipcRenderer.invoke('reset-api-credentials'),
openDashboardLink: (cuName) => ipcRenderer.invoke('open-dashboard-link', { cuName }),
getIsDev: () => ipcRenderer.invoke('get-isDev'),
getIsStaging: () => ipcRenderer.invoke('get-isStaging'),
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
openGithubRelease: (link) => ipcRenderer.invoke('open-github-release', { link }),
saveGsheetLinks: (links) => ipcRenderer.invoke('save-gsheet-links', links),
getGsheetLinks: () => ipcRenderer.invoke('get-gsheet-links'),
resetGsheetLinks: () => ipcRenderer.invoke('reset-gsheet-links'),
addGsheetLink: (link) => ipcRenderer.invoke('add-gsheet-links', link),
deleteGsheetLink: (linkId) => ipcRenderer.invoke('delete-gsheet-links', linkId)
})