fix(progresskeeper): dont remove task count listener until it reaches 0 (#5650)

If waitUltilDone() is called when you have 2 or more other tasks, the first one that is changed will still have tasks to wait for, but when it finishes it won't run because it was removed early.
(translated)
This commit is contained in:
TarikBR 2024-06-25 14:33:38 -03:00 committed by GitHub
parent 74492eaa7e
commit df0b762cf3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,8 +90,8 @@ public class ProgressKeeper {
public void onUpdateTaskCount(int taskCount) { public void onUpdateTaskCount(int taskCount) {
if(taskCount == 0) { if(taskCount == 0) {
runnable.run(); runnable.run();
removeTaskCountListener(this);
} }
removeTaskCountListener(this);
} }
}; };
addTaskCountListener(listener); addTaskCountListener(listener);