mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-18 10:52:34 +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() {
|
void initState() {
|
||||||
_initReceiveSharingIntent();
|
_initReceiveSharingIntent();
|
||||||
WidgetsBinding.instance.addPostFrameCallback(
|
WidgetsBinding.instance.addPostFrameCallback(
|
||||||
(_) => waitForFirstSync().then((_) => checkBootstrap()),
|
(_) => waitForFirstSync.then((_) => checkBootstrap()),
|
||||||
);
|
);
|
||||||
scrollController.addListener(_onScroll);
|
scrollController.addListener(_onScroll);
|
||||||
|
waitForFirstSync = _waitForFirstSync();
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +385,9 @@ class ChatListController extends State<ChatList> {
|
|||||||
setState(() => selectedRoomIds.clear());
|
setState(() => selectedRoomIds.clear());
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> waitForFirstSync() async {
|
Future<void> waitForFirstSync;
|
||||||
|
|
||||||
|
Future<void> _waitForFirstSync() async {
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
await client.roomsLoading;
|
await client.roomsLoading;
|
||||||
await client.accountDataLoading;
|
await client.accountDataLoading;
|
||||||
|
@ -430,7 +430,7 @@ class _ChatListViewBody extends StatelessWidget {
|
|||||||
.rateLimit(const Duration(seconds: 1)),
|
.rateLimit(const Duration(seconds: 1)),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
return FutureBuilder<void>(
|
return FutureBuilder<void>(
|
||||||
future: controller.waitForFirstSync(),
|
future: controller.waitForFirstSync,
|
||||||
builder: (BuildContext context, snapshot) {
|
builder: (BuildContext context, snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
final rooms = Matrix.of(context)
|
final rooms = Matrix.of(context)
|
||||||
|
Loading…
Reference in New Issue
Block a user