ywana-core8 0.1.5 → 0.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -33,27 +33,19 @@ export const TaskContextProvider = (props) => {
33
33
 
34
34
  async function executeListeners() {
35
35
  const taskIDs = Object.keys(listeners)
36
+
36
37
  for (let i = 0; i < taskIDs.length; i++) {
38
+ console.log("Execute Task Listener", taskIDs[i], taskIDs)
37
39
  const taskID = taskIDs[i]
38
40
  const tsk = await task(taskID)
39
-
40
- console.log("Task Listener", taskID, tsk.state, tsk.percentage, tsk.description)
41
-
42
41
  if (!tsk) {
43
- console.log("Task not found", taskID)
42
+ console.log("Task not found! Remove Task Listener", taskID)
44
43
  removeListener(taskID)
45
- console.log("Listener removed", taskID)
46
- continue
44
+ } else {
45
+ console.log("Execute Task Listener", taskID, tsk.state, tsk.percentage, tsk.description)
46
+ const listener = listeners[taskID]
47
+ if (listener) listener(tsk, appContextRef.current)
47
48
  }
48
-
49
- if (tsk.state === "FAULTED" || tsk.state === "CANCELED") {
50
- console.log("Task finished", taskID, task.state)
51
- removeListener(taskID)
52
- console.log("Listener removed", taskID)
53
- }
54
-
55
- const listener = listeners[taskID]
56
- if (listener) listener(tsk, appContextRef.current)
57
49
  }
58
50
  }
59
51