From d47f696ca5fec36d9f91086d963d0199815045e1 Mon Sep 17 00:00:00 2001 From: Rohit Date: Thu, 24 Apr 2025 18:47:23 +0530 Subject: [PATCH] feat: notify on socket abort run --- src/pages/MainPage.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index aa896d50..0587f2a4 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -71,7 +71,7 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps) interpretStoredRecording(runId).then(async (interpretation: boolean) => { if (!aborted) { if (interpretation) { - notify('success', t('main_page.notifications.interpretation_success', { name: runningRecordingName })); + // notify('success', t('main_page.notifications.interpretation_success', { name: runningRecordingName })); } else { notify('success', t('main_page.notifications.interpretation_failed', { name: runningRecordingName })); // destroy the created browser @@ -112,6 +112,14 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps) notify('error', t('main_page.notifications.interpretation_failed', { name: robotName })); } }); + + socket.on('run-aborted', (data) => { + setRerenderRuns(true); + + const abortedRobotName = data.robotName; + notify('success', t('main_page.notifications.abort_success', { name: abortedRobotName })); + }); + setContent('runs'); if (browserId) { notify('info', t('main_page.notifications.run_started', { name: runningRecordingName }));