Skip to content

Commit

Permalink
fix(editor): Don't show toolsUnused notice if run had errors (#12529)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb authored and riascho committed Jan 14, 2025
1 parent 279a821 commit 58e8feb
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions packages/editor-ui/src/components/OutputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
NodeConnectionType,
type IRunData,
type IRunExecutionData,
type NodeError,
type Workflow,
} from 'n8n-workflow';
import RunData from './RunData.vue';
Expand Down Expand Up @@ -120,14 +119,17 @@ const hasAiMetadata = computed(() => {
return false;
});
// Determine the initial output mode to logs if the node has an error and the logs are available
const defaultOutputMode = computed<OutputType>(() => {
const hasError =
const hasError = computed(() =>
Boolean(
workflowRunData.value &&
node.value &&
(workflowRunData.value[node.value.name]?.[props.runIndex]?.error as NodeError);
node.value &&
workflowRunData.value[node.value.name]?.[props.runIndex]?.error,
),
);
return Boolean(hasError) && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
// Determine the initial output mode to logs if the node has an error and the logs are available
const defaultOutputMode = computed<OutputType>(() => {
return hasError.value && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
});
const isNodeRunning = computed(() => {
Expand Down Expand Up @@ -216,7 +218,7 @@ const canPinData = computed(() => {
});
const allToolsWereUnusedNotice = computed(() => {
if (!node.value || runsCount.value === 0) return undefined;
if (!node.value || runsCount.value === 0 || hasError.value) return undefined;
// With pinned data there's no clear correct answer for whether
// we should use historic or current parents, so we don't show the notice,
Expand Down

0 comments on commit 58e8feb

Please sign in to comment.