Skip to content

Commit 3ec5b28

Browse files
authored
fix(editor): Don't show toolsUnused notice if run had errors (#12529)
1 parent c6b491c commit 3ec5b28

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Diff for: packages/editor-ui/src/components/OutputPanel.vue

+10-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
NodeConnectionType,
55
type IRunData,
66
type IRunExecutionData,
7-
type NodeError,
87
type Workflow,
98
} from 'n8n-workflow';
109
import RunData from './RunData.vue';
@@ -120,14 +119,17 @@ const hasAiMetadata = computed(() => {
120119
return false;
121120
});
122121
123-
// Determine the initial output mode to logs if the node has an error and the logs are available
124-
const defaultOutputMode = computed<OutputType>(() => {
125-
const hasError =
122+
const hasError = computed(() =>
123+
Boolean(
126124
workflowRunData.value &&
127-
node.value &&
128-
(workflowRunData.value[node.value.name]?.[props.runIndex]?.error as NodeError);
125+
node.value &&
126+
workflowRunData.value[node.value.name]?.[props.runIndex]?.error,
127+
),
128+
);
129129
130-
return Boolean(hasError) && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
130+
// Determine the initial output mode to logs if the node has an error and the logs are available
131+
const defaultOutputMode = computed<OutputType>(() => {
132+
return hasError.value && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
131133
});
132134
133135
const isNodeRunning = computed(() => {
@@ -216,7 +218,7 @@ const canPinData = computed(() => {
216218
});
217219
218220
const allToolsWereUnusedNotice = computed(() => {
219-
if (!node.value || runsCount.value === 0) return undefined;
221+
if (!node.value || runsCount.value === 0 || hasError.value) return undefined;
220222
221223
// With pinned data there's no clear correct answer for whether
222224
// we should use historic or current parents, so we don't show the notice,

0 commit comments

Comments
 (0)