mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-09-29 09:51:09 +00:00
fix response-counting logic
could be improved yet...
This commit is contained in:
parent
1674c04020
commit
5f604eba3c
1 changed files with 6 additions and 3 deletions
|
@ -46,13 +46,16 @@ class LitescribeAPI {
|
|||
'/address/inscriptions?address=$address&cursor=$cursor&size=$size');
|
||||
|
||||
// Check if the number of returned inscriptions equals the limit
|
||||
final list = response.data['result']['list'];
|
||||
final int total = response.data['result']['total'] as int;
|
||||
|
||||
int currentSize = 0;
|
||||
if (list != null) {
|
||||
currentSize = list.length as int;
|
||||
if (total == 0) {
|
||||
return <InscriptionData>[];
|
||||
}
|
||||
|
||||
final list = response.data['result']!['list'];
|
||||
currentSize = list.length as int;
|
||||
|
||||
if (currentSize == size && currentSize < total) {
|
||||
// If the number of returned inscriptions equals the limit and there are more inscriptions available,
|
||||
// increment the cursor and make the next API call to fetch the remaining inscriptions.
|
||||
|
|
Loading…
Reference in a new issue