mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix(editor): fix workflow not stopping on clicking stop button (#4382)
* fix(editor): fix workflow not stopping * address comment, fix for unsaved workflows
This commit is contained in:
parent
263794ce40
commit
50c18a789a
|
@ -180,7 +180,7 @@ export interface IRestApi {
|
|||
getWorkflow(id: string): Promise<IWorkflowDb>;
|
||||
getWorkflows(filter?: object): Promise<IWorkflowShortResponse[]>;
|
||||
getWorkflowFromUrl(url: string): Promise<IWorkflowDb>;
|
||||
getExecution(id: string): Promise<IExecutionResponse>;
|
||||
getExecution(id: string): Promise<IExecutionResponse | undefined>;
|
||||
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
|
||||
retryExecution(id: string, loadWorkflow?: boolean): Promise<boolean>;
|
||||
getTimezones(): Promise<IDataObject>;
|
||||
|
|
|
@ -260,7 +260,7 @@ export const pushConnection = mixins(
|
|||
this.$titleSet(workflow.name as string, 'ERROR');
|
||||
|
||||
if (
|
||||
runDataExecuted.data.resultData.error!.name === 'ExpressionError' &&
|
||||
runDataExecuted.data.resultData.error?.name === 'ExpressionError' &&
|
||||
(runDataExecuted.data.resultData.error as ExpressionError).context.functionality === 'pairedItem'
|
||||
) {
|
||||
const error = runDataExecuted.data.resultData.error as ExpressionError;
|
||||
|
|
|
@ -129,9 +129,9 @@ export const restApi = Vue.extend({
|
|||
},
|
||||
|
||||
// Returns the execution with the given name
|
||||
getExecution: async (id: string): Promise<IExecutionResponse> => {
|
||||
getExecution: async (id: string): Promise<IExecutionResponse | undefined> => {
|
||||
const response = await self.restApi().makeRestApiRequest('GET', `/executions/${id}`);
|
||||
return unflattenExecutionData(response);
|
||||
return response && unflattenExecutionData(response);
|
||||
},
|
||||
|
||||
// Deletes executions
|
||||
|
|
|
@ -1231,7 +1231,7 @@ export default mixins(
|
|||
} catch (error) {
|
||||
// Execution stop might fail when the execution has already finished. Let's treat this here.
|
||||
const execution = await this.restApi().getExecution(executionId);
|
||||
if (execution.finished) {
|
||||
if (execution?.finished) {
|
||||
const executedData = {
|
||||
data: execution.data,
|
||||
finished: execution.finished,
|
||||
|
|
Loading…
Reference in a new issue