This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Preserve emojis order when adding#2698
Open
viktorasl wants to merge 2 commits intoGitHawkApp:masterfrom
Open
Conversation
* reactions order in app is defined by array in app (not received order from API) * reactions picker & UI list share the same data structure
jdisho
reviewed
Mar 20, 2019
| init(models: [ReactionViewModel]) { | ||
| self.models = models | ||
| let reactions = IssueCommentReactionViewModel.allReactions | ||
| let sortedModels = models.sorted { (m1, m2) -> Bool in |
Member
There was a problem hiding this comment.
nit:
instead of m1, m2, why not lhs, rhs?
additionally for m1Idx, m2Idx, why not lhsContent and rhsContent
Contributor
Author
There was a problem hiding this comment.
lhs & rhs totally makes sense!
Not sure about xContent as it's an index of content in predefined array for order.
Contributor
Author
There was a problem hiding this comment.
Oh sorry, I thought I've fixed this. On it.
Contributor
Author
There was a problem hiding this comment.
So sorry it took so long. Fixed now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2403.
When inserting reaction to the middle last cell held UI state applied by
pullOutand that's why that had to be extracted to a separate method which has to be called byconfiguremethod.Not sure if private
Arrayextension is correct implementation in this case.