Use hasPreviousPage correctly to check if we are on beginning of history

This commit is contained in:
poka 2021-02-07 17:25:51 +01:00
parent e625a9bd47
commit 54a4e0dae3
2 changed files with 2 additions and 5 deletions

View File

@ -12,7 +12,6 @@ class HistoryProvider with ChangeNotifier {
String pubkey = '';
HistoryProvider(this.pubkey);
final TextEditingController outputPubkey = TextEditingController();
bool isTheEnd = false;
List transBC;
bool isFirstBuild = true;
String fetchMoreCursor;
@ -158,10 +157,8 @@ class HistoryProvider with ChangeNotifier {
"###### DEBUG H Parse blockchainTX list. Cursor: $fetchMoreCursor ######");
if (fetchMoreCursor != null) {
transBC = parseHistory(blockchainTX, _pubkey);
isTheEnd = false;
} else {
print("###### DEBUG H - Début de l'historique");
isTheEnd = true;
}
return opts;

View File

@ -233,7 +233,6 @@ 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),
@ -292,7 +291,8 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
CircularProgressIndicator(),
],
),
if (_historyProvider.isTheEnd)
// if (_historyProvider.isTheEnd) // What I did before ...
if (!_historyProvider.pageInfo['hasPreviousPage'])
Column(children: <Widget>[
SizedBox(height: 15),
Text("Début de l'historique.",