From 8983a8d5eac9d4935739e41ecdb5b99d88959695 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 20 Sep 2023 14:16:47 +0200 Subject: [PATCH] Fix #13 --- Website/interaction.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Website/interaction.js b/Website/interaction.js index ccd8351..752ebeb 100644 --- a/Website/interaction.js +++ b/Website/interaction.js @@ -1,4 +1,5 @@ -let runningJobs = []; +let monitoringJobsCount = 0; +let runningJobs = []; let waitingJobs = []; let notificationConnectorTypes = []; let libraryConnectorTypes = []; @@ -356,15 +357,18 @@ function utf8_to_b64(str) { function UpdateJobs(){ GetMonitorJobs().then((json) => { - ResetContent(); - //console.log(json); - json.forEach(job => { - var mangaView = CreateManga(job.manga, job.mangaConnector.name); - mangaView.addEventListener("click", (event) => { - ShowMangaWindow(job, job.manga, event, false); + if(monitoringJobsCount != json.length){ + ResetContent(); + //console.log(json); + json.forEach(job => { + var mangaView = CreateManga(job.manga, job.mangaConnector.name); + mangaView.addEventListener("click", (event) => { + ShowMangaWindow(job, job.manga, event, false); + }); + tasksContent.appendChild(mangaView); }); - tasksContent.appendChild(mangaView); - }); + monitoringJobsCount = json.length; + } }); GetWaitingJobs().then((json) => {