Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb committed Jan 10, 2025
1 parent d51b4cf commit f84599c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/30-langchain.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
} from '../composables/workflow';
import { NDV, WorkflowPage } from '../pages';
import { createMockNodeExecutionData, runMockWorkflowExecution } from '../utils';
import { ExecutionError } from 'n8n-workflow';

describe('Langchain Integration', () => {
beforeEach(() => {
Expand Down
13 changes: 7 additions & 6 deletions packages/editor-ui/src/components/OutputPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,17 @@ const hasAiMetadata = computed(() => {
return false;
});
const hasError = computed(
() =>
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,
),
);
// Determine the initial output mode to logs if the node has an error and the logs are available
const defaultOutputMode = computed<OutputType>(() => {
return Boolean(hasError) && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
return hasError.value && hasAiMetadata.value ? OUTPUT_TYPE.LOGS : OUTPUT_TYPE.REGULAR;
});
const isNodeRunning = computed(() => {
Expand Down Expand Up @@ -218,7 +219,7 @@ const canPinData = computed(() => {
});
const allToolsWereUnusedNotice = computed(() => {
if (!node.value || runsCount.value === 0 || hasError) 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 f84599c

Please sign in to comment.