diff --git a/src/index.tsx b/src/index.tsx index 928347c..91ab192 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -199,46 +199,44 @@ app.get('/', async (_, res) => { { } diff --git a/test.js b/test.js index 68e4261..5f3fc45 100644 --- a/test.js +++ b/test.js @@ -1,29 +1 @@ -let intervalIds = []; -function runIntervals() { - intervalIds.push(setInterval(function() { - let min = 0; - let max = 5; - let perso = Math.floor(Math.random() * (max - min + 1) + min); - let imgElement = document.getElementById(perso); - if (imgElement){ - intervalIds.push(setInterval(function() { - fetch('http://localhost:3000/code') - then(function(response) { - return response.json(); - }) - .then(function(data) { - let perso = Math.floor(Math.random() * (max - min + 1) + min); - let imgElement = document.getElementById(perso); - imgElement.src = (data[1][0]); - }); - }, 1000)); - } - - }, 5000)); - } - -function stopIntervals() { -intervalIds.forEach(clearInterval); -intervalIds = []; -} -runIntervals(); \ No newline at end of file +setTimeout((imgElement.src = (data[perso][0])), 9000); \ No newline at end of file