Skip to content

Commit

Permalink
removed unnecessary if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
MagicJinn committed Jul 5, 2023
1 parent 48c2b9e commit 5abe3e1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions mrbeastify.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ function checkImageExistence(index = 1) {
const testedURL = chrome.runtime.getURL(`${imagesPath}${index}.png`);
fetch(testedURL)
.then((response) => {
if (response.status === 200) {
// Image exists, add it to the images array
images.push(testedURL);
// Check the next image in the directory
checkImageExistence(index + 1);
}
// Image exists, add it to the images array
images.push(testedURL);
// Check the next image in the directory
checkImageExistence(index + 1);
})
.catch((error) => {
setInterval(applyOverlayToThumbnails, 100);
Expand All @@ -72,4 +70,4 @@ checkImageExistence();
function getRandomImageFromDirectory() {
const randomIndex = Math.floor(Math.random() * images.length);
return images[randomIndex];
}
}

0 comments on commit 5abe3e1

Please sign in to comment.