From d75672a757851dc41e7403fa1a7553581c0da5e7 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Mon, 27 Jul 2020 11:13:25 +0000 Subject: [PATCH] Filter the onSync stream to only include updates that we want to deal with to re-render --- CHANGELOG.md | 4 ++++ lib/views/chat_list.dart | 6 +++++- pubspec.lock | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7946ece..801edbba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# Version 0.17.0 - 2020-08-?? +### Fixes: +- Don't re-render the room list nearly as often, increasing performance + # Version 0.16.0 - 2020-07-24 ### Features - Implement web notifications diff --git a/lib/views/chat_list.dart b/lib/views/chat_list.dart index 93a78ab1..e44828db 100644 --- a/lib/views/chat_list.dart +++ b/lib/views/chat_list.dart @@ -337,7 +337,11 @@ class _ChatListState extends State { (r) => r.isFirst), ), body: StreamBuilder( - stream: Matrix.of(context).client.onSync.stream, + stream: Matrix.of(context) + .client + .onSync + .stream + .where((s) => s.hasRoomUpdate), builder: (context, snapshot) { return FutureBuilder( future: waitForFirstSync(context), diff --git a/pubspec.lock b/pubspec.lock index ed38095f..f83801f8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -159,8 +159,8 @@ packages: dependency: "direct main" description: path: "." - ref: ad8135990dcdc04ea0a650d08a681ebed27ef728 - resolved-ref: ad8135990dcdc04ea0a650d08a681ebed27ef728 + ref: "3fae58439bdc2100d26fbfb92a62c7fbb7b48903" + resolved-ref: "3fae58439bdc2100d26fbfb92a62c7fbb7b48903" url: "https://gitlab.com/famedly/famedlysdk.git" source: git version: "0.0.1" diff --git a/pubspec.yaml b/pubspec.yaml index 33114466..3d83f863 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: famedlysdk: git: url: https://gitlab.com/famedly/famedlysdk.git - ref: ad8135990dcdc04ea0a650d08a681ebed27ef728 + ref: 3fae58439bdc2100d26fbfb92a62c7fbb7b48903 localstorage: ^3.0.1+4 bubble: ^1.1.9+1