mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-04 09:14:10 +01:00
fix: Start-up time waits for first sync
This commit is contained in:
parent
457c1af4f9
commit
d38da1f91a
@ -32,12 +32,18 @@ abstract class ClientManager {
|
|||||||
}
|
}
|
||||||
if (clientNames.isEmpty) clientNames.add(PlatformInfos.clientName);
|
if (clientNames.isEmpty) clientNames.add(PlatformInfos.clientName);
|
||||||
final clients = clientNames.map(createClient).toList();
|
final clients = clientNames.map(createClient).toList();
|
||||||
|
final start = DateTime.now();
|
||||||
await Future.wait(clients.map((client) => client
|
await Future.wait(clients.map((client) => client
|
||||||
.init()
|
.init(waitForFirstSync: false)
|
||||||
.catchError((e, s) => Logs().e('Unable to initialize client', e, s))));
|
.catchError((e, s) => Logs().e('Unable to initialize client', e, s))));
|
||||||
|
final end = DateTime.now();
|
||||||
|
print(
|
||||||
|
'We needed: ${end.millisecondsSinceEpoch - start.millisecondsSinceEpoch} milliseconds');
|
||||||
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();
|
||||||
for (final client in loggedOutClients) {
|
for (final client in loggedOutClients) {
|
||||||
|
Logs().w(
|
||||||
|
'Multi account is enabled but client ${client.userID} is not logged in. Removing...');
|
||||||
clientNames.remove(client.clientName);
|
clientNames.remove(client.clientName);
|
||||||
clients.remove(client);
|
clients.remove(client);
|
||||||
}
|
}
|
||||||
|
18
pubspec.lock
18
pubspec.lock
@ -742,10 +742,12 @@ packages:
|
|||||||
matrix:
|
matrix:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: matrix
|
path: "."
|
||||||
url: "https://pub.dartlang.org"
|
ref: "krille/init-configurable"
|
||||||
source: hosted
|
resolved-ref: b3c6b5f637ed7f4547f005e5e64670c49366e73d
|
||||||
version: "0.5.3"
|
url: "https://gitlab.com/famedly/company/frontend/famedlysdk.git"
|
||||||
|
source: git
|
||||||
|
version: "0.5.4"
|
||||||
matrix_api_lite:
|
matrix_api_lite:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -964,7 +966,7 @@ packages:
|
|||||||
name: petitparser
|
name: petitparser
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.3.0"
|
version: "4.1.0"
|
||||||
pin_code_text_field:
|
pin_code_text_field:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1118,7 +1120,7 @@ packages:
|
|||||||
name: sentry
|
name: sentry
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0"
|
version: "6.0.1"
|
||||||
share:
|
share:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@ -1613,7 +1615,7 @@ packages:
|
|||||||
name: xml
|
name: xml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.3.0"
|
version: "5.1.2"
|
||||||
yaml:
|
yaml:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -1622,5 +1624,5 @@ packages:
|
|||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.0"
|
version: "3.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.14.0 <3.0.0"
|
dart: ">=2.13.0 <3.0.0"
|
||||||
flutter: ">=2.2.0"
|
flutter: ">=2.2.0"
|
||||||
|
@ -49,7 +49,10 @@ dependencies:
|
|||||||
intl: any
|
intl: any
|
||||||
localstorage: ^4.0.0+1
|
localstorage: ^4.0.0+1
|
||||||
lottie: ^1.1.0
|
lottie: ^1.1.0
|
||||||
matrix: ^0.5.3
|
matrix:
|
||||||
|
git:
|
||||||
|
url: https://gitlab.com/famedly/company/frontend/famedlysdk.git
|
||||||
|
ref: krille/init-configurable
|
||||||
matrix_link_text: ^1.0.2
|
matrix_link_text: ^1.0.2
|
||||||
native_imaging:
|
native_imaging:
|
||||||
git: https://gitlab.com/famedly/libraries/native_imaging.git
|
git: https://gitlab.com/famedly/libraries/native_imaging.git
|
||||||
|
Loading…
Reference in New Issue
Block a user