From 9f2ba673de0693cb8737bdee7929a22f31f8b987 Mon Sep 17 00:00:00 2001 From: Marian Moravcik Date: Sun, 29 Jan 2023 10:53:36 +0100 Subject: [PATCH] Fix display for notification task in progress --- frontend/src/modules/socketio/reducer.ts | 3 ++- frontend/src/modules/task/index.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/modules/socketio/reducer.ts b/frontend/src/modules/socketio/reducer.ts index 83444f99c..403fc0ce0 100644 --- a/frontend/src/modules/socketio/reducer.ts +++ b/frontend/src/modules/socketio/reducer.ts @@ -2,7 +2,7 @@ import queryClient from "@/apis/queries"; import { QueryKeys } from "@/apis/queries/keys"; import { LOG } from "@/utilities/console"; import { setCriticalError, setOnlineStatus } from "@/utilities/event"; -import { showNotification } from "@mantine/notifications"; +import { cleanNotifications, showNotification } from "@mantine/notifications"; import { notification, task } from "../task"; export function createDefaultReducer(): SocketIO.Reducer[] { @@ -15,6 +15,7 @@ export function createDefaultReducer(): SocketIO.Reducer[] { key: "connect_error", any: () => { setCriticalError("Cannot connect to backend"); + cleanNotifications(); }, }, { diff --git a/frontend/src/modules/task/index.ts b/frontend/src/modules/task/index.ts index 7e2687c57..ab3ddb8c3 100644 --- a/frontend/src/modules/task/index.ts +++ b/frontend/src/modules/task/index.ts @@ -126,6 +126,7 @@ class TaskDispatcher { } else { showNotification(notification.progress.pending(item.id, item.header)); this.progress[item.id] = item; + this.updateProgress(items); } }); }