Skip to content

Commit

Permalink
Fix display issues in the notification center
Browse files Browse the repository at this point in the history
  • Loading branch information
LASER-Yi committed Mar 19, 2022
1 parent c1a26fd commit aaf4b7c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion frontend/src/modules/task/utilities.ts
@@ -1,5 +1,7 @@
import { LOG } from "@/utilities/console";
import taskManager from ".";
import { siteAddProgress, siteRemoveProgress } from "../redux/actions";
import store from "../redux/store";
import { GroupName } from "./group";

export function createTask<T extends Task.AnyCallable>(
Expand All @@ -19,10 +21,27 @@ export function createTask<T extends Task.AnyCallable>(

export function dispatchTask(tasks: Task.TaskRef[], group: GroupName) {
setTimeout(async () => {
for (const ref of tasks) {
for (let index = 0; index < tasks.length; index++) {
const ref = tasks[index];
LOG("info", "dispatching task", ref.name);

store.dispatch(
siteAddProgress([
{
id: group,
header: group,
name: ref.name,
value: index,
count: tasks.length,
},
])
);

await taskManager.run(ref);
}

// TODO: Also remove from taskManager
store.dispatch(siteRemoveProgress([group]));
});
}

Expand Down

0 comments on commit aaf4b7c

Please sign in to comment.