From b722c314be50c0cc7be8861b10802a6d0b48104d Mon Sep 17 00:00:00 2001
From: vjrj <vjrj@comunes.org>
Date: Sat, 30 Sep 2023 13:20:49 +0200
Subject: [PATCH] More logs and init by default

---
 lib/ui/ui_helpers.dart | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/ui/ui_helpers.dart b/lib/ui/ui_helpers.dart
index ab6dca8..58f9d9d 100644
--- a/lib/ui/ui_helpers.dart
+++ b/lib/ui/ui_helpers.dart
@@ -23,6 +23,7 @@ import '../data/models/node_list_cubit.dart';
 import '../g1/api.dart';
 import '../g1/currency.dart';
 import '../shared_prefs_helper.dart';
+import 'logger.dart';
 import 'notification_controller.dart';
 import 'widgets/first_screen/circular_icon.dart';
 
@@ -258,7 +259,7 @@ void initGetItAll() {
   }
 }
 
-Future<void> fetchTransactionsFromBackground([bool init = false]) async {
+Future<void> fetchTransactionsFromBackground([bool init = true]) async {
   if (init) {
     await hydratedInit();
     if (SharedPreferencesHelper().cards.isEmpty) {
@@ -277,12 +278,14 @@ Future<void> fetchTransactionsFromBackground([bool init = false]) async {
       }
     }
   }
+  loggerDev('Initialized background context');
   final GetIt getIt = GetIt.instance;
   final AppCubit appCubit = getIt.get<AppCubit>();
   final MultiWalletTransactionCubit transCubit =
       getIt.get<MultiWalletTransactionCubit>();
   final NodeListCubit nodeListCubit = getIt.get<NodeListCubit>();
   for (final CesiumCard card in SharedPreferencesHelper().cards) {
+    loggerDev('Fetching transactions for ${card.pubKey} in background');
     transCubit.fetchTransactions(nodeListCubit, appCubit, pubKey: card.pubKey);
   }
   if (inDevelopment) {
-- 
GitLab