Skip to content
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

fix: reverse listing of saved badges #570

Merged
merged 4 commits into from
Dec 26, 2019
Merged

fix: reverse listing of saved badges #570

merged 4 commits into from
Dec 26, 2019

Conversation

refactor-droidyy
Copy link
Member

Fixes #569

@auto-label auto-label bot added the fix label Dec 23, 2019
@refactor-droidyy refactor-droidyy changed the title fix: reverse orientation fix: reverse listing of saved badges Dec 23, 2019
@adityastic
Copy link
Collaborator

adityastic commented Dec 23, 2019

@refactor-droidyy this would be useful if the files were read according to the date of creation. But right now it just reads the files in ascending order.

@refactor-droidyy
Copy link
Member Author

@adityastic so do we need to add date data in badge Config JSON.

@adityastic
Copy link
Collaborator

@refactor-droidyy Config is just meant to store the config data, so let's just leave it for the important badge information. Let's sort this file list with date created then reverse it.

Comment on lines 55 to 59
when {
a.lastModified() - b.lastModified() > 0 -> 1
a.lastModified() - b.lastModified() < 0 -> -1
else -> 0
}
Copy link
Member

@iamareebjamal iamareebjamal Dec 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return a.lastModified() - b.lastModified()

@refactor-droidyy
Copy link
Member Author

@iamareebjamal, please review.

Copy link
Collaborator

@adityastic adityastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal looks good to me 👍

@iamareebjamal iamareebjamal merged commit c89e3a0 into fossasia:development Dec 26, 2019
@refactor-droidyy refactor-droidyy deleted the orien branch December 28, 2019 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest saved sadges items are shown at bottom
4 participants