Open larbijirari opened 5 years ago
Don't persist it, comment out plugins: [createSharedMutations()],
@NoelDavies thanks for your reply.
we relay on plugins: [createSharedMutations()]
to allow axios authenticate using certificate from the main process, once we comment plugins: [createSharedMutations()]
our request for example axios.get(...)
won't work because it's executed from the renderer process because it doesn't support certificate authentication.
@larbijirari Your main process should essentially be a router / event handler, it shouldn't be doing anything chunky. I'd suggest finding another way to get your authentication to work and possibly creating a hidden/fake window to handle these tasks and offload them from your primary renderer's processing power for painting etc.
You can delete the file that is saved manually.
Underneath the hood this module is using electron-store
that writes a json file to app.getPath('userData');
https://github.com/vue-electron/vuex-electron/blob/master/src/persisted-state.js
https://www.npmjs.com/package/electron-store/v/2.0.0
So in your main process check to see where that is on your file system:
console.log('userData', app.getPath('userData'));
Then cd into the directory and remove the vuex.json
file.
It would be cool if the plugin exposed a method that let us clear the saved state (basic CRUD). But I susspect you can instantiate your own Store
and load it with the same name then call the .clear()
method on it to clear the state manually.
after page refresh store giveback previous data stored. how can i prevent store from keeping data?