[Sdk] fix minor bugs

This commit is contained in:
Christian Pauly 2019-10-24 09:53:53 +00:00
parent d48e98d7e6
commit 1ef67fcd4b
3 changed files with 3 additions and 3 deletions

View File

@ -462,7 +462,7 @@ class Connection {
}
}
if (userTimestampMap[mxid]["ts"] is int) {
if (userTimestampMap[mxid].containsKey("ts")) {
if (receiptStateContent[eventID] == null)
receiptStateContent[eventID] = {"m.read": {}};
else if (receiptStateContent[eventID]["m.read"] == null)

View File

@ -180,7 +180,7 @@ class RoomList {
bool sortLock = false;
sort() {
if (sortLock) return;
if (sortLock || rooms.length < 2) return;
sortLock = true;
rooms?.sort((a, b) =>
b.timeCreated.toTimeStamp().compareTo(a.timeCreated.toTimeStamp()));

View File

@ -122,7 +122,7 @@ class Timeline {
bool sortLock = false;
sort() {
if (sortLock) return;
if (sortLock || events.length < 2) return;
sortLock = true;
events
?.sort((a, b) => b.time.toTimeStamp().compareTo(a.time.toTimeStamp()));