-
Notifications
You must be signed in to change notification settings - Fork 67
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
After performing an action [delete|archive], our toggle switches [archived|private|forked] are reset #39
Comments
Looks like the issue comes from setting all the toggle values to true regardless of their previous state here: repo-remover/src/components/ReposTable.vue Lines 292 to 294 in 7b89739
I tried to dig in as best as I could, but as a React guy, I'm not sure how Vue 'maintains' previous state. Thanks for an awesome tool! Hope this issue helps. I think the same thing occurs with the selection of number of rows to display. |
Thanks @technoplato, I think if those settings are passed down as props from the parent, we can ensure they hold when the component is re-created 👍 |
If you give me a tiny bit of guidance, I think I could figure this one out. I wanted to the other day, but tried to stay on task with what I was doing. If you'd rather just take care of it, cool cool cool. And thanks so much for an awesome tool! Saved me probably at least a couple hours. Do you have a coffee donate link or anything? |
Oh awesome, thanks! I think what we want to do is pass a prop, e.g.
In Details.vue we'd create this variable to pass along as a prop:
We'd then update the ReposTable component to accept these new props:
This gets the data flowing down from parent -> child, but we'll need to use an event to update the parent when the toggle is actually clicked by the child. The However, we don't really need to keep the parent's values synced with the child's, we really only need to send these back to the parent before we destroy the ReposTable instance, so perhaps when the ReposTable is about to modify repos, it should fire and event to let the parent get the current state of the toggles? I'm relatively new to Vue as well so this approach probably isn't 100% accurate. If you need help let me know, and thanks for offering to fix this.
Wow, I really appreciate the offer, but I really don't need it. What about sending a coffee to a charity instead? :) |
Awesome awesome awesome. I’m going to need to take some time to grok this. I know how I’d do it in React, but the Vue paradigm is just different enough that it’ll be a tad bit difficult for me. Next time I have the opportunity I’ll grab a strangers coffee ☕️:thumbup: |
Describe the bug
After performing an action [delete|archive], our toggle switches [archived|private|forked] are reset
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Whatever toggles I checked remain checked after an action is performed.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: