From 296841d3343bff9cb8f5761515ab85dec4145c73 Mon Sep 17 00:00:00 2001 From: MagicJinn Date: Mon, 3 Jul 2023 16:16:56 +0200 Subject: [PATCH] removed unnecessary error code --- mrbeastify.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mrbeastify.js b/mrbeastify.js index 9547908..8a0ce67 100644 --- a/mrbeastify.js +++ b/mrbeastify.js @@ -47,6 +47,7 @@ function applyOverlayToThumbnails() { function checkImageAmountInDirectory() { // Checks for all images in the images folder instead of using a preset array, making the extension infinitely scalable let imageIndex = 1; + function checkImageExistence() { const testedURL = chrome.runtime.getURL(`${imagesPath}${imageIndex}.png`); fetch(testedURL) @@ -57,13 +58,7 @@ function checkImageAmountInDirectory() { // Checks for all images in the images // Check the next image in the directory imageIndex++; checkImageExistence(); - } else { - throw new Error("Image not found"); } - }) - .catch(error => { - // Stop checking for new images - console.log("Total MrBeast images found:", images.length); }); } checkImageExistence();