vue-electron / vuex-electron

Integration of Vuex and Electron
MIT License
305 stars 97 forks source link

only Main process tries to set state #30

Closed michaeljpeake closed 3 weeks ago

michaeljpeake commented 5 years ago

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

Bomberus commented 5 years ago

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

michaeljpeake commented 5 years ago

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.

Bomberus commented 5 years ago

Thanks, good to know.

akodkod commented 5 years ago

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

michaeljpeake commented 3 weeks ago

Closing as years old now.