diff --git a/main.py b/main.py
index a9baca2b..be5bb1ce 100644
--- a/main.py
+++ b/main.py
@@ -335,10 +335,11 @@ class PromptQueue:
def task_done(self, item_id, outputs):
with self.mutex:
- self.history[item_id] = { "prompt": self.currently_running.pop(item_id), "outputs": {} }
+ prompt = self.currently_running.pop(item_id)
+ self.history[prompt[1]] = { "prompt": prompt, "outputs": {} }
for o in outputs:
if "ui" in outputs[o]:
- self.history[item_id]["outputs"][o] = outputs[o]["ui"]
+ self.history[prompt[1]]["outputs"][o] = outputs[o]["ui"]
self.server.queue_updated()
def get_current_queue(self):
diff --git a/webshit/index.html b/webshit/index.html
index 64b9618d..ecc6a244 100644
--- a/webshit/index.html
+++ b/webshit/index.html
@@ -790,7 +790,7 @@ function loadItems(type) {
button.style.fontSize = "10px";
button.delete_id = id;
button.onclick = function(event) {
- deleteQueueElement(type, event.target.delete_id, loadItems);
+ deleteQueueElement(type, event.target.delete_id, () => loadItems(type));
};
append_to_element.appendChild(button);
}
@@ -807,11 +807,11 @@ function loadItems(type) {
if(type === "queue") {
items = data.queue_pending;
} else {
- items = Object.values(data).map(d => d.prompt);
+ items = Object.values(data);
}
items.sort((a, b) => a[0] - b[0]);
- for (let i in items) {
- append_to_list(items[i], queuecontents, true, type === "queue"? null : data[i].outputs);
+ for (let i of items) {
+ append_to_list(type === "queue" ? i : i.prompt, queuecontents, true, i.outputs);
}
}).catch((response) => {console.log(response)});
}
@@ -891,7 +891,7 @@ function clearItems(type) {
-
+
@@ -901,7 +901,7 @@ function clearItems(type) {