From e625a9bd47d012af3fb62c75cd54e98b3ffa86a6 Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Sun, 7 Feb 2021 16:57:50 +0100
Subject: [PATCH] Continue debug GVA cursor

---
 lib/models/history.dart  | 7 ++++---
 lib/screens/history.dart | 1 +
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/models/history.dart b/lib/models/history.dart
index bdc0f5f1..663e3d06 100644
--- a/lib/models/history.dart
+++ b/lib/models/history.dart
@@ -16,6 +16,7 @@ class HistoryProvider with ChangeNotifier {
   List transBC;
   bool isFirstBuild = true;
   String fetchMoreCursor;
+  Map pageInfo;
 
   Future scan() async {
     await Permission.camera.request();
@@ -130,11 +131,11 @@ class HistoryProvider with ChangeNotifier {
     final List<dynamic> blockchainTX =
         (result.data['txsHistoryBc']['both']['edges'] as List<dynamic>);
 
-    final Map pageInfo = result.data['txsHistoryBc']['both']['pageInfo'];
+    pageInfo = result.data['txsHistoryBc']['both']['pageInfo'];
 
     fetchMoreCursor = pageInfo['endCursor'];
-    print(pageInfo['hasPreviousPage']);
-    print(pageInfo['hasNextPage']);
+    print('hasPreviousPage: ' + pageInfo['hasPreviousPage'].toString());
+    print('hasNextPage: ' + pageInfo['hasNextPage'].toString());
 
     if (fetchMoreCursor != null) {
       opts = FetchMoreOptions(
diff --git a/lib/screens/history.dart b/lib/screens/history.dart
index ba1fe803..1b3f66e7 100644
--- a/lib/screens/history.dart
+++ b/lib/screens/history.dart
@@ -233,6 +233,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
                       indent: 0,
                       endIndent: 0,
                     ),
+                    // !_historyProvider.pageInfo['hasPreviousPage'] //TODO: fix value of hasPreviousPage
                     _historyProvider.transBC == null
                         ? Text('Aucune transaction à afficher.')
                         : loopTransactions(context, result),
-- 
GitLab