@@ -60,21 +60,14 @@ export const RunScriptModal: React.FC<RunScriptModalProps> = ({
|
||||
// 4. Ждём завершения по id
|
||||
const jobResult = await scriptsApi.waitJob(runResult.id);
|
||||
|
||||
// 5. Обновляем джоб
|
||||
addJob({
|
||||
id: jobResult.id,
|
||||
scriptPath,
|
||||
// 5. Обновляем существующий джоб (не создаём новый!)
|
||||
const terminalStore = useTerminalStore.getState();
|
||||
terminalStore.updateJob(runResult.id, {
|
||||
command: jobResult.command,
|
||||
stdin: jobResult.stdin,
|
||||
});
|
||||
|
||||
// Обновляем с финальным статусом
|
||||
const terminalStore = useTerminalStore.getState();
|
||||
terminalStore.updateJob(jobResult.id, {
|
||||
status: jobResult.status,
|
||||
stdout: jobResult.stdout,
|
||||
stderr: jobResult.stderr,
|
||||
stdin: jobResult.stdin,
|
||||
isRunning: false,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user