refactor: Use DateTime method instead of comparing milliseconds

This commit is contained in:
Christian Pauly 2022-10-12 11:33:00 +02:00
parent 157b488255
commit 779c278854
1 changed files with 3 additions and 4 deletions

View File

@ -324,11 +324,10 @@ class Client extends MatrixApi {
if (r == null) { if (r == null) {
return prev; return prev;
} }
final prevLast = final prevLast = prev.lastEvent?.originServerTs ?? DateTime(0);
prev.lastEvent?.originServerTs.millisecondsSinceEpoch ?? 0; final rLast = r.lastEvent?.originServerTs ?? DateTime(0);
final rLast = r.lastEvent?.originServerTs.millisecondsSinceEpoch ?? 0;
return rLast > prevLast ? r : prev; return rLast.isAfter(prevLast) ? r : prev;
}).id; }).id;
} }
} }