-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dispatch not being fired from component #12
Comments
I think I ran into this issue before Did you make sure to import store from '../renderer/store' inside your electron index.js (the one where the createWindow function and auto updater is) |
Confused about this. I had the exact same issue as @BlackConure and it adding
as mentioned by @Stormtv to the src/main/index.js fixed the issue for me. Dispatching to store is now working. Thank you |
Why would you need to import the store but not reference it anywhere? In Nuxt, the store is in this.$store. By doing an import and having it work seems to suggest that somewhere down the line it is referencing window.store instead of this.store (?) @daniel-farina I am using Nuxt which doesn't use src/main/index.js and doesn't have '../renderer/store'. Store in Nuxt is added via /store/index.js file. My code is more like this:
For now, I am using originalDispatch() until this can get addressed. |
@SGarno you need to create an instance of the store in all your processes (main and renderer), so they could communicate with each other. |
I am still facing this issue, I have even imported vuex store in the component itself. UPDATE: This comment fixes the problem. |
We need to import store in the |
I am having an issue with attempting to dispatch an action within a component. It seems that the dispatch is not being received by the store action.
However, if I change the setter to use this.$store.originalDispatch() it works fine.
It appears that notifyMain in shared-mutations.js is not working. What am I missing here?
(FYI: I am using Nuxt, so access to the store is via this.$store.)
In my template I have:
The setter and getter I have defined as:
The updateSample never gets fired in my store:
The text was updated successfully, but these errors were encountered: