mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 04:59:26 +01:00
feat: Speed up app start
This commit is contained in:
parent
3fdf2bf80d
commit
b903bf8472
@ -386,6 +386,8 @@ class ChatListController extends State<ChatList> {
|
|||||||
|
|
||||||
Future<void> waitForFirstSync() async {
|
Future<void> waitForFirstSync() async {
|
||||||
final client = Matrix.of(context).client;
|
final client = Matrix.of(context).client;
|
||||||
|
await client.roomsLoading;
|
||||||
|
await client.accountDataLoading;
|
||||||
if (client.prevBatch?.isEmpty ?? true) {
|
if (client.prevBatch?.isEmpty ?? true) {
|
||||||
await client.onFirstSync.stream.first;
|
await client.onFirstSync.stream.first;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,10 @@ abstract class ClientManager {
|
|||||||
}
|
}
|
||||||
final clients = clientNames.map(createClient).toList();
|
final clients = clientNames.map(createClient).toList();
|
||||||
await Future.wait(clients.map((client) => client
|
await Future.wait(clients.map((client) => client
|
||||||
.init(waitForFirstSync: false)
|
.init(
|
||||||
|
waitForFirstSync: false,
|
||||||
|
waitUntilFullLoaded: false,
|
||||||
|
)
|
||||||
.catchError((e, s) => Logs().e('Unable to initialize client', e, s))));
|
.catchError((e, s) => Logs().e('Unable to initialize client', e, s))));
|
||||||
if (clients.length > 1 && clients.any((c) => !c.isLogged())) {
|
if (clients.length > 1 && clients.any((c) => !c.isLogged())) {
|
||||||
final loggedOutClients = clients.where((c) => !c.isLogged()).toList();
|
final loggedOutClients = clients.where((c) => !c.isLogged()).toList();
|
||||||
|
@ -752,9 +752,11 @@ packages:
|
|||||||
matrix:
|
matrix:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: matrix
|
path: "."
|
||||||
url: "https://pub.dartlang.org"
|
ref: "krille/improve-start-up-time"
|
||||||
source: hosted
|
resolved-ref: "6585cf195f414175c72693f720569d9ce68319d2"
|
||||||
|
url: "https://gitlab.com/famedly/company/frontend/famedlysdk.git"
|
||||||
|
source: git
|
||||||
version: "0.7.0-nullsafety.3"
|
version: "0.7.0-nullsafety.3"
|
||||||
matrix_api_lite:
|
matrix_api_lite:
|
||||||
dependency: "direct overridden"
|
dependency: "direct overridden"
|
||||||
|
@ -112,5 +112,9 @@ dependency_overrides:
|
|||||||
hosted:
|
hosted:
|
||||||
name: geolocator_android
|
name: geolocator_android
|
||||||
url: https://hanntech-gmbh.gitlab.io/free2pass/flutter-geolocator-floss
|
url: https://hanntech-gmbh.gitlab.io/free2pass/flutter-geolocator-floss
|
||||||
|
matrix:
|
||||||
|
git:
|
||||||
|
url: https://gitlab.com/famedly/company/frontend/famedlysdk.git
|
||||||
|
ref: krille/improve-start-up-time
|
||||||
matrix_api_lite: ^0.5.0
|
matrix_api_lite: ^0.5.0
|
||||||
provider: 5.0.0
|
provider: 5.0.0
|
Loading…
Reference in New Issue
Block a user