adding in global store access but not done

This commit is contained in:
talksik
2022-03-18 11:02:56 -04:00
parent 478b785145
commit 18a50cd121
2 changed files with 18 additions and 2 deletions
+10 -2
View File
@@ -1,6 +1,7 @@
import { contextBridge, ipcRenderer } from "electron";
import Channels from "./constants";
import { STORE_ITEMS } from "./store";
const electronAPI = {
auth: {
@@ -11,8 +12,15 @@ const electronAPI = {
ipcRenderer.on(channel, (event, ...args) => func(...args));
},
},
batteryApi: {},
fileApi: {},
store: {
get(val: STORE_ITEMS) {
return ipcRenderer.sendSync("electron-store-get", val);
},
set(property: STORE_ITEMS, val: any) {
ipcRenderer.send("electron-store-set", property, val);
},
// Other method you want to add like has(), reset(), etc.
},
};
contextBridge.exposeInMainWorld("electronAPI", electronAPI);