-
Notifications
You must be signed in to change notification settings - Fork 8
Cash 513 #707
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
Cash 513 #707
Conversation
| methods: { | ||
| toggleFavorite() { | ||
| this.$emit('favorite-toggled'); | ||
| if (this.isFavorite === false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoke with @BoulderBrains about incorporating this into GridLoanCard and LoanCardController instead.
| toggleFavorite() { | ||
| // optimistically toggle it locally first | ||
| this.isFavorite = !this.isFavorite; | ||
| // this.isFavorite = !this.isFavorite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prob should keep this. It sets the "optimistic value" and immediately shows the new expected star state.
| }); | ||
| } else { | ||
| this.$kvTrackEvent( | ||
| 'favorited', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "Lending" to put it into the context of other lending flow events.
| _forEach(data.errors, ({ message }) => { | ||
| this.$showTipMsg(message, 'error'); | ||
| }); | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to also set this.isFavorite just inside this else statement using the return value from your mutation "data".
| }).catch(error => { | ||
| console.error(error); | ||
| }); | ||
| this.isFavorite = !this.isFavorite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this won't be necessary with the changes mentioned above.
… moving into GridLoanCard and LoanCardController
|
Alright, @mcstover I've made some changes after our discussion today and this is now working again. A couple things I still want to talk through with you.
|
|
This new branch has been created for the improvement of the favorite functionality work that we discussed through the course of this work: https://github.com/kiva/ui/tree/work-toward-improved-favoriting |
No description provided.