Update api fetching
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Dominic Grimm 2022-08-02 11:29:17 +02:00
parent c8901a91c2
commit 0b7d26f150

View file

@ -5,9 +5,12 @@
let listingIndex = 0; let listingIndex = 0;
function updateListingIndex(amount: number): void { function updateListingIndex(amount: number): void {
if (listingIndex == amount - 2) {
fetchData = api.fetchData();
}
if (listingIndex >= amount - 1) { if (listingIndex >= amount - 1) {
listingIndex = 0; listingIndex = 0;
fetchData = api.fetchData();
} else { } else {
listingIndex++; listingIndex++;
} }