Merge branch 'sdk-fix-minor-bugs' into 'master'

[Sdk] fix minor bugs

See merge request famedly/famedlysdk!109
This commit is contained in:
Christian Pauly 2019-10-24 09:53:54 +00:00
commit fb0750b69a
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()));