feat: pass params for abort handler

This commit is contained in:
amhsirak
2025-06-06 00:44:12 +05:30
parent c1097c801b
commit 326dcc8fa3

View File

@@ -49,14 +49,14 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps)
const { notify, setRerenderRuns, setRecordingId } = useGlobalInfoStore(); const { notify, setRerenderRuns, setRecordingId } = useGlobalInfoStore();
const navigate = useNavigate(); const navigate = useNavigate();
const abortRunHandler = (runId: string) => { const abortRunHandler = (runId: string, robotName: string, browserId: string) => {
aborted = true; aborted = true;
notifyAboutAbort(runId).then(async (response) => { notifyAboutAbort(runId).then(async (response) => {
if (response) { if (response) {
notify('success', t('main_page.notifications.abort_success', { name: runningRecordingName })); notify('success', t('main_page.notifications.abort_success', { name: robotName }));
await stopRecording(ids.browserId); await stopRecording(ids.browserId);
} else { } else {
notify('error', t('main_page.notifications.abort_failed', { name: runningRecordingName })); notify('error', t('main_page.notifications.abort_failed', { name: robotName }));
} }
setRerenderRuns(true); setRerenderRuns(true);
}) })
@@ -157,7 +157,7 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps)
case 'runs': case 'runs':
return <Runs return <Runs
currentInterpretationLog={currentInterpretationLog} currentInterpretationLog={currentInterpretationLog}
abortRunHandler={() => abortRunHandler(ids.runId)} abortRunHandler={abortRunHandler}
runId={ids.runId} runId={ids.runId}
runningRecordingName={runningRecordingName} runningRecordingName={runningRecordingName}
/>; />;