refactor: Only preload client for GUI start

This commit is contained in:
krille-chan 2023-10-05 17:39:33 +02:00
commit d569a00df7
No known key found for this signature in database

View file

@ -22,11 +22,6 @@ void main() async {
Logs().nativeColors = !PlatformInfos.isIOS; Logs().nativeColors = !PlatformInfos.isIOS;
final clients = await ClientManager.getClients(); final clients = await ClientManager.getClients();
// Preload first client
final firstClient = clients.firstOrNull;
await firstClient?.roomsLoading;
await firstClient?.accountDataLoading;
// If the app starts in detached mode, we assume that it is in // If the app starts in detached mode, we assume that it is in
// background fetch mode for processing push notifications. This is // background fetch mode for processing push notifications. This is
// currently only supported on Android. // currently only supported on Android.
@ -63,6 +58,11 @@ Future<void> startGui(List<Client> clients) async {
} }
} }
// Preload first client
final firstClient = clients.firstOrNull;
await firstClient?.roomsLoading;
await firstClient?.accountDataLoading;
runApp(FluffyChatApp(clients: clients, pincode: pin)); runApp(FluffyChatApp(clients: clients, pincode: pin));
} }