Open Zyles opened 5 years ago
If I use both createPersistedState, createSharedMutations I can call store.dispatch('setAuthCode', query.code ) from my main process.
createPersistedState, createSharedMutations
store.dispatch('setAuthCode', query.code )
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)
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?
This should fix it
Already have import store from './store' in my background.js
import store from './store'
Are you using electron-vue boilerplate?
I had the exact same problem as you and above mentioned solution fixed it.
https://github.com/vue-electron/vuex-electron/issues/44
If I use both
createPersistedState, createSharedMutations
I can callstore.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?