Merge branch 'client-fix-sort-rooms' into 'master'
[Client] Sort rooms on first sync See merge request famedly/famedlysdk!151
This commit is contained in:
commit
bf831554fc
|
@ -705,7 +705,9 @@ class Client {
|
||||||
} else {
|
} else {
|
||||||
await handleSync(syncResp);
|
await handleSync(syncResp);
|
||||||
}
|
}
|
||||||
if (this.prevBatch == null) this.onFirstSync.add(true);
|
if (this.prevBatch == null) {
|
||||||
|
this.onFirstSync.add(true);
|
||||||
|
}
|
||||||
this.prevBatch = syncResp["next_batch"];
|
this.prevBatch = syncResp["next_batch"];
|
||||||
if (hash == _syncRequest.hashCode) unawaited(_sync());
|
if (hash == _syncRequest.hashCode) unawaited(_sync());
|
||||||
} on MatrixException catch (exception) {
|
} on MatrixException catch (exception) {
|
||||||
|
@ -1010,7 +1012,6 @@ class Client {
|
||||||
.compareTo(a.timeCreated.millisecondsSinceEpoch);
|
.compareTo(a.timeCreated.millisecondsSinceEpoch);
|
||||||
|
|
||||||
_sortRooms() {
|
_sortRooms() {
|
||||||
if (prevBatch == null) return;
|
|
||||||
if (_sortLock || rooms.length < 2) return;
|
if (_sortLock || rooms.length < 2) return;
|
||||||
_sortLock = true;
|
_sortLock = true;
|
||||||
rooms?.sort(sortRoomsBy);
|
rooms?.sort(sortRoomsBy);
|
||||||
|
|
Loading…
Reference in a new issue