mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34:07 -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;
|
||||
return result;
|
||||
});
|
||||
const canvasNodes = computed(() => workflowsStore.allNodes);
|
||||
const isLogsOpen = computed(() => workflowsStore.isLogsPanelOpen);
|
||||
const previousChatMessages = computed(() => workflowsStore.getPastChatMessages);
|
||||
|
||||
|
@ -70,7 +71,7 @@ const { runWorkflow } = useRunWorkflow({ router });
|
|||
const { chatTriggerNode, connectedNode, allowFileUploads, setChatTriggerNode, setConnectedNode } =
|
||||
useChatTrigger({
|
||||
workflow,
|
||||
canvasNodes: workflowsStore.allNodes,
|
||||
canvasNodes,
|
||||
getNodeByName: workflowsStore.getNodeByName,
|
||||
getNodeType: nodeTypesStore.getNodeType,
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { ComputedRef } from 'vue';
|
||||
import { ref, computed } from 'vue';
|
||||
import type { ComputedRef, MaybeRef } from 'vue';
|
||||
import { ref, computed, unref } from 'vue';
|
||||
import {
|
||||
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
|
||||
NodeConnectionType,
|
||||
|
@ -19,7 +19,7 @@ import type { INodeUi } from '@/Interface';
|
|||
export interface ChatTriggerDependencies {
|
||||
getNodeByName: (name: string) => INodeUi | null;
|
||||
getNodeType: (type: string, version: number) => INodeTypeDescription | null;
|
||||
canvasNodes: INodeUi[];
|
||||
canvasNodes: MaybeRef<INodeUi[]>;
|
||||
workflow: ComputedRef<Workflow>;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ export function useChatTrigger({
|
|||
|
||||
/** Gets the chat trigger node from the workflow */
|
||||
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),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue