|
@@ -1,4 +1,4 @@
|
|
|
-window.fetchData = function(from, to){
|
|
|
|
|
|
|
+window.fetchData = function(from, to, callback){
|
|
|
retrieveDates = [];
|
|
retrieveDates = [];
|
|
|
|
|
|
|
|
//Compares dates to dates already stored and makes a list of those needed
|
|
//Compares dates to dates already stored and makes a list of those needed
|
|
@@ -52,12 +52,10 @@ window.fetchData = function(from, to){
|
|
|
}
|
|
}
|
|
|
newIndex += 2;
|
|
newIndex += 2;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- if(newIndex > 100 || oldIndex > 100){
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ data.dates = mergedDates;
|
|
|
|
|
+
|
|
|
for(let set of response.data){
|
|
for(let set of response.data){
|
|
|
if(set.transactions[0] < data.transactions[0]){
|
|
if(set.transactions[0] < data.transactions[0]){
|
|
|
data.transactions = set.transactions.concat(data.transactions);
|
|
data.transactions = set.transactions.concat(data.transactions);
|
|
@@ -85,8 +83,12 @@ window.fetchData = function(from, to){
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ callback();
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((err)=>{});
|
|
.catch((err)=>{});
|
|
|
|
|
+ }else{
|
|
|
|
|
+ callback();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|