vuex-electron icon indicating copy to clipboard operation
vuex-electron copied to clipboard

only Main process tries to set state

Open michaeljpeake opened this issue 5 years ago • 4 comments

My testing (on Windows only) has found frequent file errors caused by one or more renderers trying to write the store state to disk at the same time as the main process.

The if statement I have added prevents processes of type renderer from duplicating the work of the main process.

Fixes #27

michaeljpeake avatar Mar 06 '19 13:03 michaeljpeake

Short question, why do you check for: process.env.NODE_ENV === "test" ? Will this be false, once I deploy my electron app?

Bomberus avatar Mar 06 '19 15:03 Bomberus

Short question, why do you check for: process.env.NODE_ENV === "test" ? Will this be false, once I deploy my electron app?

This is to allow the tests to run, as they do not create an Electron browser (main) process.

michaeljpeake avatar Mar 06 '19 15:03 michaeljpeake

Thanks, good to know.

Bomberus avatar Mar 07 '19 10:03 Bomberus

https://github.com/vue-electron/vuex-electron/issues/44

akodkod avatar Aug 29 '19 14:08 akodkod