Closed Anas-Nabulsi closed 2 years ago
The "unprotected.json" is the json file that's meant to hold system-level config values that aren't considered secure (ie. x/y of the screen position, size of app screen), so that you can persist these values across app launches see here.
I have a theory of what's wrong, can you try using this code?
const store = new Store({});
const carsStore = new Store({
filename: "cars",
unprotectedFilename: "cars_unprotected",
unprotectedPath: ""
});
contextBridge.exposeInMainWorld("api", {
...
store: store.preloadBindings(ipcRenderer, fs),
carsStore: carsStore.preloadBindings(ipcRenderer, fs),
...
});
That actually worked. Thank you for saving me time. I added the cars_unprotected because I thought a conflict is occurring between the unprotected files of the two stores since they have the same default filename value of "unprotected".
I'm trying to have multiple stores in my project. I set them up as follows in main.js:
And in the preload.js:
This throws the following error in the console and prevents from executing preload.js
Why does it search for a directory name called "unprotected.json" ? Any help is appreciated.