mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-03 08:57:28 -08:00
fix(editor): Fix canvasNodes reactivity in canvas chat (no-changelog) (#11717)
This commit is contained in:
parent
ca8cb455ba
commit
b22142ddb8
|
@ -52,6 +52,7 @@ const isChatOpen = computed(() => {
|
||||||
const result = workflowsStore.isChatPanelOpen;
|
const result = workflowsStore.isChatPanelOpen;
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
const canvasNodes = computed(() => workflowsStore.allNodes);
|
||||||
const isLogsOpen = computed(() => workflowsStore.isLogsPanelOpen);
|
const isLogsOpen = computed(() => workflowsStore.isLogsPanelOpen);
|
||||||
const previousChatMessages = computed(() => workflowsStore.getPastChatMessages);
|
const previousChatMessages = computed(() => workflowsStore.getPastChatMessages);
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ const { runWorkflow } = useRunWorkflow({ router });
|
||||||
const { chatTriggerNode, connectedNode, allowFileUploads, setChatTriggerNode, setConnectedNode } =
|
const { chatTriggerNode, connectedNode, allowFileUploads, setChatTriggerNode, setConnectedNode } =
|
||||||
useChatTrigger({
|
useChatTrigger({
|
||||||
workflow,
|
workflow,
|
||||||
canvasNodes: workflowsStore.allNodes,
|
canvasNodes,
|
||||||
getNodeByName: workflowsStore.getNodeByName,
|
getNodeByName: workflowsStore.getNodeByName,
|
||||||
getNodeType: nodeTypesStore.getNodeType,
|
getNodeType: nodeTypesStore.getNodeType,
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { ComputedRef } from 'vue';
|
import type { ComputedRef, MaybeRef } from 'vue';
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, unref } from 'vue';
|
||||||
import {
|
import {
|
||||||
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
|
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
|
||||||
NodeConnectionType,
|
NodeConnectionType,
|
||||||
|
@ -19,7 +19,7 @@ import type { INodeUi } from '@/Interface';
|
||||||
export interface ChatTriggerDependencies {
|
export interface ChatTriggerDependencies {
|
||||||
getNodeByName: (name: string) => INodeUi | null;
|
getNodeByName: (name: string) => INodeUi | null;
|
||||||
getNodeType: (type: string, version: number) => INodeTypeDescription | null;
|
getNodeType: (type: string, version: number) => INodeTypeDescription | null;
|
||||||
canvasNodes: INodeUi[];
|
canvasNodes: MaybeRef<INodeUi[]>;
|
||||||
workflow: ComputedRef<Workflow>;
|
workflow: ComputedRef<Workflow>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ export function useChatTrigger({
|
||||||
|
|
||||||
/** Gets the chat trigger node from the workflow */
|
/** Gets the chat trigger node from the workflow */
|
||||||
function setChatTriggerNode() {
|
function setChatTriggerNode() {
|
||||||
const triggerNode = canvasNodes.find((node) =>
|
const triggerNode = unref(canvasNodes).find((node) =>
|
||||||
[CHAT_TRIGGER_NODE_TYPE, MANUAL_CHAT_TRIGGER_NODE_TYPE].includes(node.type),
|
[CHAT_TRIGGER_NODE_TYPE, MANUAL_CHAT_TRIGGER_NODE_TYPE].includes(node.type),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue