mirror of https://github.com/calzoneman/sync.git
Fix issue with queue progress
If the user queues a PeerTube link with a long uuid the progress bar would never go away. Now it will just check against the hostname.
This commit is contained in:
parent
8774dc89e7
commit
ffd01fe30b
|
@ -3216,6 +3216,9 @@ function startQueueSpinner(data) {
|
||||||
if (data.type === "yp") {
|
if (data.type === "yp") {
|
||||||
id = "$any";
|
id = "$any";
|
||||||
}
|
}
|
||||||
|
if (data.type === "pt") {
|
||||||
|
id = data.id.split(';').shift()
|
||||||
|
}
|
||||||
|
|
||||||
var progress = $("<div/>").addClass("progress").attr("id", "queueprogress")
|
var progress = $("<div/>").addClass("progress").attr("id", "queueprogress")
|
||||||
.data("queue-id", id);
|
.data("queue-id", id);
|
||||||
|
@ -3232,12 +3235,14 @@ function startQueueSpinner(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopQueueSpinner(data) {
|
function stopQueueSpinner(data) {
|
||||||
var shouldRemove = (data !== null &&
|
const qid = $("#queueprogress").data("queue-id");
|
||||||
typeof data === 'object' &&
|
switch (true){
|
||||||
$("#queueprogress").data("queue-id") === data.id);
|
case data === null:
|
||||||
shouldRemove = shouldRemove || data === null;
|
case qid === "$any":
|
||||||
shouldRemove = shouldRemove || $("#queueprogress").data("queue-id") === "$any";
|
case qid === data?.id:
|
||||||
if (shouldRemove) {
|
return $("#queueprogress").remove();
|
||||||
|
}
|
||||||
|
if (data?.type === "pt" && new RegExp(qid).test(data?.id)) {
|
||||||
$("#queueprogress").remove();
|
$("#queueprogress").remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue