Skip to content

Commit

Permalink
show a different message for a started task with no progress
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarWKH committed Sep 7, 2020
1 parent e93b096 commit 277a3f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions celery_progress/static/celery_progress/celery_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ class CeleryProgressBar {
progressBarElement.style.backgroundColor = '#68a9ef';
progressBarElement.style.width = progress.percent + "%";
var description = progress.description || "";
if (progress.current == 0 && progress.pending) {
progressBarMessageElement.textContent = 'Waiting for task to start...'
if (progress.current == 0) {
if (progress.pending === true) {
progressBarMessageElement.textContent = 'Waiting for task to start...';
} else {
progressBarMessageElement.textContent = 'Task started...';
}
} else {
progressBarMessageElement.textContent = progress.current + ' of ' + progress.total + ' processed. ' + description;
progressBarMessageElement.textContent = progress.current + ' of ' + progress.total + ' processed. ' + description;
}
}

Expand Down

0 comments on commit 277a3f1

Please sign in to comment.