vue-electron / vuex-electron

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

Not updating the state #43

Open Zyles opened 5 years ago

Zyles commented 5 years ago

If I use both createPersistedState, createSharedMutations I can call store.dispatch('setAuthCode', query.code ) from my main process.

If I remove createSharedMutations I can not.

But using both, I can not update the state in my component using: this.$store.dispatch('setAuthCode', code)

If I remove createSharedMutations I can update state in my component.

Without createSharedMutations the vuex.json updates, but it is not reacting and updating in the component.

How can I call an action to mutate the state from both main and render process? I thought this was the point of the package. Not either or.

What gives?

vterzic commented 5 years ago

This should fix it

Zyles commented 5 years ago

Already have import store from './store' in my background.js

vterzic commented 5 years ago

Are you using electron-vue boilerplate?

I had the exact same problem as you and above mentioned solution fixed it.

akodkod commented 5 years ago

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