mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 19:36:25 +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
|
// seem to be acessible via dart
|
||||||
var aDt = a.created ?? a.fileLastModified;
|
var aDt = a.created ?? a.fileLastModified;
|
||||||
var bDt = b.created ?? b.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) {
|
if (bDt == null || aDt == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -94,6 +100,15 @@ class SortedNotesFolder
|
|||||||
case SortingMode.Modified:
|
case SortingMode.Modified:
|
||||||
var aDt = a.modified ?? a.fileLastModified;
|
var aDt = a.modified ?? a.fileLastModified;
|
||||||
var bDt = b.modified ?? b.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) {
|
if (bDt == null || aDt == null) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user