ywana-core8 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5522,10 +5522,15 @@ var TaskContextProvider = function TaskContextProvider(props) {
5522
5522
  if (!tsk) {
5523
5523
  console.log("Task not found! Remove Task Listener", taskID);
5524
5524
  removeListener(taskID);
5525
- } else {
5526
- console.log("Execute Task Listener", taskID, tsk.state, tsk.percentage, tsk.description);
5525
+ } else if (tsk.state === "COMPLETED") {
5526
+ console.log("Task Completed! Execute Task Listener for the last time", taskID);
5527
5527
  var listener = listeners[taskID];
5528
5528
  if (listener) listener(tsk, appContextRef.current);
5529
+ removeListener(taskID);
5530
+ } else {
5531
+ console.log("Execute Task Listener", taskID, tsk.state, tsk.percentage, tsk.description);
5532
+ var _listener = listeners[taskID];
5533
+ if (_listener) _listener(tsk, appContextRef.current);
5529
5534
  }
5530
5535
  });
5531
5536
  });