From 84462783cca4d46bf37b65074f232316ff0fcde3 Mon Sep 17 00:00:00 2001
From: vjrj <vjrj@comunes.org>
Date: Sat, 30 Sep 2023 12:50:28 +0200
Subject: [PATCH] Add logs and disable fetch during dev to test back processing

---
 lib/main.dart | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/main.dart b/lib/main.dart
index 75eb164f..696468f1 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -185,16 +185,18 @@ void workManagerCallbackDispatcher() {
   Workmanager()
       .executeTask((String task, Map<String, dynamic>? inputData) async {
     try {
+      loggerDev(
+          '---------- Start fetchTransactionsTask Workmanager background task');
       switch (task) {
         case fetchWalletsTransactionsTask:
-          logger(
-              '---------- fetchTransactionsTask Workmanager background task');
           await NotificationController.initializeLocalNotifications();
           fetchTransactionsFromBackground(true);
           break;
         case Workmanager.iOSBackgroundTask:
           break;
       }
+      loggerDev(
+          '---------- End fetchTransactionsTask Workmanager background task');
     } catch (err, stacktrace) {
       logger(err.toString());
       await Sentry.captureException(err, stackTrace: stacktrace);
@@ -360,7 +362,10 @@ class _GinkgoAppState extends State<GinkgoApp> {
         .schedule(Schedule.parse(kReleaseMode ? '*/10 * * * *' : '*/5 * * * *'),
             () async {
       logger('---------- fetchTransactions via cron');
-      fetchTransactions(context);
+      // Disabled to check the back development
+      if (!inDevelopment) {
+        fetchTransactions(context);
+      }
     });
 
     if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
-- 
GitLab