From f0caf0f669aed08bb63a10ec6aeb4b74efdd8c38 Mon Sep 17 00:00:00 2001 From: MillenniumEarl Date: Tue, 15 Dec 2020 14:02:41 +0100 Subject: [PATCH] Fixing comments --- app/scripts/latest-fetch.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/scripts/latest-fetch.js b/app/scripts/latest-fetch.js index a75265a..d30f77e 100644 --- a/app/scripts/latest-fetch.js +++ b/app/scripts/latest-fetch.js @@ -43,10 +43,11 @@ module.exports.fetchLatest = async function(query, limit = 30) { // Save the URLs for(const result of response.data.msg.data) { - if(fetchedResults >= limit) continue; - const gameURL = new URL(result.thread_id, threadURL).href; - resultURLs.push(gameURL); - fetchedResults += 1; + if(fetchedResults < limit) { + const gameURL = new URL(result.thread_id, threadURL).href; + resultURLs.push(gameURL); + fetchedResults += 1; + } } // Increment page and check for it's existence @@ -93,6 +94,7 @@ function parseLatestURL(query, page = 1) { url.searchParams.append("tags[]", tag); } } + if (query.prefixes) { for (const p of query.prefixes) { url.searchParams.append("prefixes[]", p);