SortedNotesFolder: if created/modified not present it goes in the end

This commit is contained in:
Vishesh Handa
2020-02-28 14:55:11 +01:00
parent 215dfc2cec
commit 2de1d17ee1

View File

@ -86,6 +86,12 @@ class SortedNotesFolder
// seem to be acessible via dart
var aDt = a.created ?? a.fileLastModified;
var bDt = b.created ?? b.fileLastModified;
if (aDt == null && bDt != null) {
return -1;
}
if (aDt != null && bDt == null) {
return -1;
}
if (bDt == null || aDt == null) {
return 0;
}
@ -94,6 +100,15 @@ class SortedNotesFolder
case SortingMode.Modified:
var aDt = a.modified ?? a.fileLastModified;
var bDt = b.modified ?? b.fileLastModified;
if (aDt == null && bDt != null) {
return -1;
}
if (aDt != null && bDt == null) {
return -1;
}
if (bDt == null || aDt == null) {
return 0;
}
if (bDt == null || aDt == null) {
return 0;
}