fix(editor): Remove infinite loading in not found workflow level execution (#5174)

fix(editor): Getting rid of infinite loading in workflow level execution view
This commit is contained in:
Csaba Tuncsik 2023-01-23 14:28:59 +01:00 committed by GitHub
parent 683492155e
commit 96dddf12e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,13 +84,12 @@ export default mixins(
computed: { computed: {
...mapStores(useTagsStore, useNodeTypesStore, useSettingsStore, useUIStore, useWorkflowsStore), ...mapStores(useTagsStore, useNodeTypesStore, useSettingsStore, useUIStore, useWorkflowsStore),
hidePreview(): boolean { hidePreview(): boolean {
const nothingToShow = this.executions.length === 0 && this.filterApplied;
const activeNotPresent = const activeNotPresent =
this.filterApplied && this.filterApplied &&
(this.executions as IExecutionsSummary[]).find( (this.executions as IExecutionsSummary[]).find(
(ex) => ex.id === this.activeExecution.id, (ex) => ex.id === this.activeExecution.id,
) === undefined; ) === undefined;
return this.loading || nothingToShow || activeNotPresent; return this.loading || !this.executions.length || activeNotPresent;
}, },
filterApplied(): boolean { filterApplied(): boolean {
return this.filter.status !== ''; return this.filter.status !== '';
@ -393,9 +392,7 @@ export default mixins(
return []; return [];
} }
try { try {
const executions: IExecutionsSummary[] = return await this.workflowsStore.loadCurrentWorkflowExecutions(this.filter);
await this.workflowsStore.loadCurrentWorkflowExecutions(this.filter);
return executions;
} catch (error) { } catch (error) {
this.$showError(error, this.$locale.baseText('executionsList.showError.refreshData.title')); this.$showError(error, this.$locale.baseText('executionsList.showError.refreshData.title'));
return []; return [];