From 8279392d37645fae25449c3bca96967543ce8458 Mon Sep 17 00:00:00 2001 From: Schoumi Date: Tue, 23 Jul 2019 15:36:09 +0200 Subject: [PATCH] avoid fetch data already retrieved (last declaration) again and again --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 196a72c..56cbea8 100644 --- a/src/index.js +++ b/src/index.js @@ -171,6 +171,7 @@ async function getAllDeclaration(params, declarationList) { if (exist) { let lastSaved = declarationList.indexOf(accData.lastSaved) if (lastSaved !== -1) lastPeriod = lastSaved + if (lastPeriod === 0) lastPeriod = -1 } for (let i = lastPeriod; i >= 0; i--) { try {