Skip to content

Commit 2cbbe7a

Browse files
dredavRokt33r
authored andcommitted
Check if the float is quals (abs value is greather 0.01) and return the sub value when not.
1 parent 19fc1fd commit 2cbbe7a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

browser/main/NoteList/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ function sortByAlphabetical (a, b) {
4141
const floatA = parseFloat(matchA[1])
4242
const floatB = parseFloat(matchB[1])
4343

44-
if (floatA < floatB) {
45-
return -1
46-
} else if (floatA > floatB) {
47-
return 1
44+
if (Math.abs(floatA - floatB) > 0.01) {
45+
return floatA - floatB
4846
}
4947

5048
// The float values are equal. We will compare the full title.

0 commit comments

Comments
 (0)