-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
Add partial like in item with variants #338
Add partial like in item with variants #338
Conversation
renaudjenny
commented
Dec 28, 2020
- Add an half star to show that the item has been partially completed, meaning at least one of its variants is liked, but not all of them.
- Display bottom sheet variations if the item has variants instead of adding it to the collection without their variants.
- Fix Urgently need fix #230
* Add an half star to show that the item has been partially completed, meaning at least one of its variants is liked, but not all of them.
* Display bottom sheet variations if the item has variants instead of adding it to the collection without their variants.
* Previously the item wasn't marked as liked if one of its variant is liked
LOL I wanted to show a video recording of the result, but it's now impossible to upload video on GitHub :( |
|
||
if !items.contains(item) && variants.completionStatus(for: item) != .unstarted { | ||
// We add the item to the liked items if at least one of its variant is added | ||
toggleItem(item: item) |
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 should _ =
to silence the warning.
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.
Done
toggleItem(item: item) | ||
} else if items.contains(item) && variants.completionStatus(for: item) == .unstarted { | ||
// We remove the item from the liked items if there is none of its variants liked | ||
toggleItem(item: item) |
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.
Same
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.
Done, I'm also wondering if at the end of the day @discardableResult
could come handy for the function. As it's not used in a lot of places, I think that's fine for now.
I love the functionality and it works very good from the list, but it missing two things.
Appart from that, awesome! |
Hi @Dimillian, yes good idea, I will work on that today 🙂 |
…at-add-partial-like-in-item-with-variants
* Also refactor the Bottom sheet view to let it be in its own View * Add the behaviour inside the ItemDetailView for the main Like button, so it fixes the "doing nothing" behaviour
@Dimillian, animation is done, I really like it! Let me know if you do too � |
Love it! LGTM! |