Fix the wrong sorting of follow_updates_page. Close #206

This commit is contained in:
2025-02-19 22:38:18 +08:00
parent a471e79ef2
commit ee0da9a26a

View File

@@ -133,7 +133,19 @@ class _FollowUpdatesPageState extends AutomaticGlobalState<FollowUpdatesPage> {
} else if (b.updateTime == null) {
return 1;
}
return b.updateTime!.compareTo(a.updateTime!);
try {
var aNums = a.updateTime!.split('-').map(int.parse).toList();
var bNums = b.updateTime!.split('-').map(int.parse).toList();
for (int i = 0; i < aNums.length; i++) {
if (aNums[i] != bNums[i]) {
return bNums[i] - aNums[i];
}
}
return 0;
}
catch(_) {
return 0;
}
});
}