From 8fb0324135b49a18e43f0fc463d9f9937678d5ed Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 20 Sep 2023 14:43:29 +0200 Subject: [PATCH] feat(app): Do not wait for all jobs to complete on startup If we don't add the `await` keyword, the future is executed in the background. This allows us to speed up app startup slightly. --- mobile/lib/main.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart index 911cbd771..a6c8ec929 100644 --- a/mobile/lib/main.dart +++ b/mobile/lib/main.dart @@ -268,14 +268,15 @@ class _TenTenOneAppState extends State { await runBackend(config); FLog.info(text: "Backend started"); - await orderChangeNotifier.initialize(); - await positionChangeNotifier.initialize(); - await candlestickChangeNotifier.initialize(); + orderChangeNotifier.initialize(); + positionChangeNotifier.initialize(); + candlestickChangeNotifier.initialize(); - await logAppSettings(config); + logAppSettings(config); - final lastLogin = await rust.api.updateLastLogin(); - FLog.debug(text: "Last login was at ${lastLogin.date}"); + rust.api + .updateLastLogin() + .then((lastLogin) => FLog.debug(text: "Last login was at ${lastLogin.date}")); } on FfiException catch (error) { FLog.error(text: "Failed to initialise: Error: ${error.message}", exception: error); } catch (error) {