-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Sorting notes alphabetically now sort starting numbers in titles right #2910
Conversation
… starting at all titles and compare these.
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.
LGTM 🎉
browser/main/NoteList/index.js
Outdated
const floatA = parseFloat(matchA[1]) | ||
const floatB = parseFloat(matchB[1]) | ||
|
||
if (floatA < floatB) { |
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.
Rather than using if statement, return floatA - floatB
should be enough.
@dredav I've submitted a change request. I'll merge this as soon as you resolve it. |
…he sub value when not.
Thanks for your review @Rokt33r. I've removed the |
@Rokt33r What do you think?
|
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.
Sorry for my late review. How do you think? @dredav
Description
Sorting titles with numbers tries to match float values of left and right titles at comparison. When both numbers are floats and not equal we can do a direct compare. In all other cases the full title will compare.
Screenshot before
Screenshot after
Issue fixed
#2894
Type of changes
Checklist: