Skip to content

Commit

Permalink
removed unnecessary error code
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicJinn committed Jul 3, 2023
1 parent a587d14 commit 296841d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions mrbeastify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
Expand Down

0 comments on commit 296841d

Please sign in to comment.