mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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>;
|
getWorkflow(id: string): Promise<IWorkflowDb>;
|
||||||
getWorkflows(filter?: object): Promise<IWorkflowShortResponse[]>;
|
getWorkflows(filter?: object): Promise<IWorkflowShortResponse[]>;
|
||||||
getWorkflowFromUrl(url: string): Promise<IWorkflowDb>;
|
getWorkflowFromUrl(url: string): Promise<IWorkflowDb>;
|
||||||
getExecution(id: string): Promise<IExecutionResponse>;
|
getExecution(id: string): Promise<IExecutionResponse | undefined>;
|
||||||
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
|
deleteExecutions(sendData: IExecutionDeleteFilter): Promise<void>;
|
||||||
retryExecution(id: string, loadWorkflow?: boolean): Promise<boolean>;
|
retryExecution(id: string, loadWorkflow?: boolean): Promise<boolean>;
|
||||||
getTimezones(): Promise<IDataObject>;
|
getTimezones(): Promise<IDataObject>;
|
||||||
|
|
|
@ -260,7 +260,7 @@ export const pushConnection = mixins(
|
||||||
this.$titleSet(workflow.name as string, 'ERROR');
|
this.$titleSet(workflow.name as string, 'ERROR');
|
||||||
|
|
||||||
if (
|
if (
|
||||||
runDataExecuted.data.resultData.error!.name === 'ExpressionError' &&
|
runDataExecuted.data.resultData.error?.name === 'ExpressionError' &&
|
||||||
(runDataExecuted.data.resultData.error as ExpressionError).context.functionality === 'pairedItem'
|
(runDataExecuted.data.resultData.error as ExpressionError).context.functionality === 'pairedItem'
|
||||||
) {
|
) {
|
||||||
const error = runDataExecuted.data.resultData.error as ExpressionError;
|
const error = runDataExecuted.data.resultData.error as ExpressionError;
|
||||||
|
|
|
@ -129,9 +129,9 @@ export const restApi = Vue.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// Returns the execution with the given name
|
// 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}`);
|
const response = await self.restApi().makeRestApiRequest('GET', `/executions/${id}`);
|
||||||
return unflattenExecutionData(response);
|
return response && unflattenExecutionData(response);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Deletes executions
|
// Deletes executions
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ export default mixins(
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Execution stop might fail when the execution has already finished. Let's treat this here.
|
// Execution stop might fail when the execution has already finished. Let's treat this here.
|
||||||
const execution = await this.restApi().getExecution(executionId);
|
const execution = await this.restApi().getExecution(executionId);
|
||||||
if (execution.finished) {
|
if (execution?.finished) {
|
||||||
const executedData = {
|
const executedData = {
|
||||||
data: execution.data,
|
data: execution.data,
|
||||||
finished: execution.finished,
|
finished: execution.finished,
|
||||||
|
|
Loading…
Reference in a new issue