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

Not updating the state

Open Zyles opened this issue 4 years ago • 4 comments

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?

Zyles avatar Aug 06 '19 17:08 Zyles

This should fix it

vterzic avatar Aug 15 '19 12:08 vterzic

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

Zyles avatar Aug 15 '19 23:08 Zyles

Are you using electron-vue boilerplate?

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

vterzic avatar Aug 16 '19 12:08 vterzic

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

akodkod avatar Aug 29 '19 14:08 akodkod