From ca3e8de43262ccf7971c95cdd520488664d8a018 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 19 Jun 2024 11:02:04 -0300 Subject: [PATCH] feat: Add lockChat functionality to FlowStore This commit adds the lockChat functionality to the FlowStore in order to control the chat lock state. The method is implemented to update the state variable. This feature enhances the user experience by allowing the chat to be locked or unlocked as needed. --- src/frontend/src/stores/flowStore.ts | 4 ++++ src/frontend/src/types/zustand/flow/index.ts | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 597308e25..24e3a83d3 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -43,6 +43,10 @@ import useFlowsManagerStore from "./flowsManagerStore"; // this is our useStore hook that we can use in our components to get parts of the store and call actions const useFlowStore = create((set, get) => ({ onFlowPage: false, + lockChat: false, + setLockChat: (lockChat) => { + set({ lockChat }); + }, setOnFlowPage: (FlowPage) => set({ onFlowPage: FlowPage }), flowState: undefined, flowBuildStatus: {}, diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index 00ef76891..afc5ed150 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -161,4 +161,6 @@ export type FlowStoreType = { buildId?: string, ) => void; getNodePosition: (nodeId: string) => { x: number; y: number }; + setLockChat: (lock: boolean) => void; + lockChat: boolean; };