From d569a00df772c4ee03aa43ee260f20fcb8c80071 Mon Sep 17 00:00:00 2001 From: krille-chan Date: Thu, 5 Oct 2023 17:39:33 +0200 Subject: [PATCH] refactor: Only preload client for GUI start --- lib/main.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 933522f8c..1adfa077c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,11 +22,6 @@ void main() async { Logs().nativeColors = !PlatformInfos.isIOS; 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 // background fetch mode for processing push notifications. This is // currently only supported on Android. @@ -63,6 +58,11 @@ Future startGui(List clients) async { } } + // Preload first client + final firstClient = clients.firstOrNull; + await firstClient?.roomsLoading; + await firstClient?.accountDataLoading; + runApp(FluffyChatApp(clients: clients, pincode: pin)); }