From f0256494fd8c15045fa1b56eb6288765c2ec1a1c Mon Sep 17 00:00:00 2001
From: glax <johanna@bernloehr.eu>
Date: Tue, 23 May 2023 18:12:45 +0200
Subject: [PATCH] HidePopup after interaction

---
 Website/interaction.js | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/Website/interaction.js b/Website/interaction.js
index 90086d9..39a27c8 100644
--- a/Website/interaction.js
+++ b/Website/interaction.js
@@ -80,6 +80,7 @@ searchPublicationQuery.addEventListener("keypress", (event) => {
                    var option = CreatePublication(publication, connectorSelect.value);
                    option.addEventListener("click", () => {
                        CreateTask("DownloadNewChapters", selectRecurrence.value, connectorSelect.value, publication.internalId, "en");
+                       HidePopup();
                        selectPublication.replaceChildren();
                    });
                    selectPublication.appendChild(option);
@@ -111,17 +112,6 @@ function CreatePublication(publication, connector){
 function DeleteTaskClick(){
     taskToDelete = tasks.filter(tTask => tTask.publication.internalId === toRemoveId)[0];
     DeleteTask("DownloadNewChapters", taskToDelete.connectorName, toRemoveId);
-    ResetContent();
-    GetTasks()
-        //.then(json => console.log(json))
-        .then(json => json.forEach(task => {
-            var publication = CreatePublication(task.publication, task.connectorName);
-            publication.addEventListener("click", (event) => ShowPublicationViewerWindow(task.publication.internalId, event));
-            tasksContent.appendChild(publication);
-
-            if(tasks.filter(tTask => tTask.publication.internalId === task.publication.internalId) < 1)
-                tasks.push(task);
-        }));
     HidePopup();
 }
 
@@ -212,4 +202,4 @@ setInterval(() => {
             if(tasks.filter(tTask => tTask.publication.internalId === task.publication.internalId) < 1)
                 tasks.push(task);
         }));
-}, 5000);
\ No newline at end of file
+}, 1000);
\ No newline at end of file