fix: read loan data
This commit is contained in:
parent
f202dd7b79
commit
2a4d77abb9
@ -240,14 +240,14 @@
|
|||||||
//function to read all loan details of the user
|
//function to read all loan details of the user
|
||||||
function readAllLoans() {
|
function readAllLoans() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const LASTTX_IDB_KEY = "U#" + floDapps.user.id;
|
let user_floID = floCrypto.toFloID(floDapps.user.id);
|
||||||
|
const LASTTX_IDB_KEY = "U#" + user_floID;
|
||||||
compactIDB.readData("lastTx", LASTTX_IDB_KEY).then(lastTx => {
|
compactIDB.readData("lastTx", LASTTX_IDB_KEY).then(lastTx => {
|
||||||
var query_options = { sentOnly: true, tx: true, filter: d => typeof d == 'string' && d.includes(APP_IDENTIFIER) };
|
var query_options = { tx: true, filter: d => typeof d == 'string' && d.includes(APP_IDENTIFIER) };
|
||||||
if (typeof lastTx == 'number') //lastTx is tx count (*backward support)
|
if (typeof lastTx == 'number') //lastTx is tx count (*backward support)
|
||||||
query_options.ignoreOld = lastTx;
|
query_options.ignoreOld = lastTx;
|
||||||
else if (typeof lastTx == 'string') //lastTx is txid of last tx
|
else if (typeof lastTx == 'string') //lastTx is txid of last tx
|
||||||
query_options.after = lastTx;
|
query_options.after = lastTx;
|
||||||
let user_floID = floCrypto.toFloID(floDapps.user.id);
|
|
||||||
floBlockchainAPI.readData(user_floID, query_options).then(result => {
|
floBlockchainAPI.readData(user_floID, query_options).then(result => {
|
||||||
let p = [];
|
let p = [];
|
||||||
for (var i = result.items.length - 1; i >= 0; i--) {
|
for (var i = result.items.length - 1; i >= 0; i--) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user