From 3b6d4565ae9b19c4864eba994caf192b2ca16849 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 4 Jan 2020 16:31:14 +0000 Subject: [PATCH] =?UTF-8?q?[Client]=C2=A0Sort=20rooms=20on=20first=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/Client.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/Client.dart b/lib/src/Client.dart index 859b463..9abeb75 100644 --- a/lib/src/Client.dart +++ b/lib/src/Client.dart @@ -705,7 +705,9 @@ class Client { } else { await handleSync(syncResp); } - if (this.prevBatch == null) this.onFirstSync.add(true); + if (this.prevBatch == null) { + this.onFirstSync.add(true); + } this.prevBatch = syncResp["next_batch"]; if (hash == _syncRequest.hashCode) unawaited(_sync()); } on MatrixException catch (exception) { @@ -1010,7 +1012,6 @@ class Client { .compareTo(a.timeCreated.millisecondsSinceEpoch); _sortRooms() { - if (prevBatch == null) return; if (_sortLock || rooms.length < 2) return; _sortLock = true; rooms?.sort(sortRoomsBy);