mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 18:38:36 +08:00
SortedNotesFolder: if created/modified not present it goes in the end
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user