mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-19 10:39:26 +01:00
fix: Chat list flickering
This commit is contained in:
parent
bda4727490
commit
3342071acf
@ -166,9 +166,10 @@ class ChatListController extends State<ChatList> {
|
||||
void initState() {
|
||||
_initReceiveSharingIntent();
|
||||
WidgetsBinding.instance.addPostFrameCallback(
|
||||
(_) => waitForFirstSync().then((_) => checkBootstrap()),
|
||||
(_) => waitForFirstSync.then((_) => checkBootstrap()),
|
||||
);
|
||||
scrollController.addListener(_onScroll);
|
||||
waitForFirstSync = _waitForFirstSync();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@ -384,7 +385,9 @@ class ChatListController extends State<ChatList> {
|
||||
setState(() => selectedRoomIds.clear());
|
||||
}
|
||||
|
||||
Future<void> waitForFirstSync() async {
|
||||
Future<void> waitForFirstSync;
|
||||
|
||||
Future<void> _waitForFirstSync() async {
|
||||
final client = Matrix.of(context).client;
|
||||
await client.roomsLoading;
|
||||
await client.accountDataLoading;
|
||||
|
@ -430,7 +430,7 @@ class _ChatListViewBody extends StatelessWidget {
|
||||
.rateLimit(const Duration(seconds: 1)),
|
||||
builder: (context, snapshot) {
|
||||
return FutureBuilder<void>(
|
||||
future: controller.waitForFirstSync(),
|
||||
future: controller.waitForFirstSync,
|
||||
builder: (BuildContext context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
final rooms = Matrix.of(context)
|
||||
|
Loading…
Reference in New Issue
Block a user