From 419c1b5b3c0fcb62a9cc9ef6946c23d4ef02fb91 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Wed, 5 Jul 2023 16:24:23 +0530 Subject: [PATCH] floExchangeAPI v1.2.0a - Minor fix in reading stored lastTx --- docs/scripts/floExchangeAPI.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/scripts/floExchangeAPI.js b/docs/scripts/floExchangeAPI.js index c737d89..685ba12 100644 --- a/docs/scripts/floExchangeAPI.js +++ b/docs/scripts/floExchangeAPI.js @@ -1,6 +1,6 @@ 'use strict'; -(function (EXPORTS) { //floExchangeAPI v1.2.0 +(function (EXPORTS) { //floExchangeAPI v1.2.0a const exchangeAPI = EXPORTS; const DEFAULT = { @@ -1731,13 +1731,12 @@ if (typeof nodes !== 'object' || nodes === null) throw Error('nodes must be an object') else - lastTx = parseInt(localStorage.getItem(_l('lastTx'))) || 0; + lastTx = localStorage.getItem(_l('lastTx')); } catch (error) { nodes = {}; trusted = new Set(); assets = new Set(); tags = new Set(); - lastTx = undefined; } var query_options = { sentOnly: true, pattern: DEFAULT.marketApp }; @@ -1784,7 +1783,7 @@ tags.add(t); } }); - localStorage.setItem(_l('lastTx'), result.totalTxs); + localStorage.setItem(_l('lastTx'), result.lastItem); localStorage.setItem(_l('nodes'), JSON.stringify(nodes)); localStorage.setItem(_l('trusted'), Array.from(trusted).join(",")); localStorage.setItem(_l('assets'), Array.from(assets).join(","));