diff --git a/src/components/Buttons/FileAttachmentButton/FileAttachmentButton.tsx b/src/components/Buttons/FileAttachmentButton/FileAttachmentButton.tsx index abe5fd7f..cf7e38f4 100644 --- a/src/components/Buttons/FileAttachmentButton/FileAttachmentButton.tsx +++ b/src/components/Buttons/FileAttachmentButton/FileAttachmentButton.tsx @@ -119,8 +119,8 @@ const FileAttachmentButton = () => { } await handleSubmitText("📄 " + fileNames.join(", "), settings.fileAttachment?.sendFileName); await fileHandler({userInput: inputRef.current?.value as string, prevPath: getPrevPath(), - goToPath, setTextAreaValue, injectMessage, streamMessage, removeMessage, endStreamMessage, - openChat, showToast, dismissToast, files + currPath: getCurrPath(), goToPath, setTextAreaValue, injectMessage, streamMessage, + removeMessage, endStreamMessage, openChat, showToast, dismissToast, files }); } }; diff --git a/src/hooks/internal/useBotEffectInternal.tsx b/src/hooks/internal/useBotEffectInternal.tsx index c6de2346..de3dea6b 100644 --- a/src/hooks/internal/useBotEffectInternal.tsx +++ b/src/hooks/internal/useBotEffectInternal.tsx @@ -245,8 +245,10 @@ export const useBotEffectInternal = () => { return; } - const params = {prevPath: getPrevPath(), goToPath, setTextAreaValue, userInput: paramsInputRef.current, - endStreamMessage, injectMessage, removeMessage, streamMessage, openChat, showToast, dismissToast}; + const params = {prevPath: getPrevPath(), currPath: getCurrPath(), goToPath, setTextAreaValue, + userInput: paramsInputRef.current, endStreamMessage, injectMessage, removeMessage, streamMessage, + openChat, showToast, dismissToast + }; // calls the new block for preprocessing upon change to path. const callNewBlock = async (currPath: keyof Flow, block: Block, params: Params) => { diff --git a/src/hooks/internal/useSubmitInputInternal.tsx b/src/hooks/internal/useSubmitInputInternal.tsx index c1543dbd..5aca003c 100644 --- a/src/hooks/internal/useSubmitInputInternal.tsx +++ b/src/hooks/internal/useSubmitInputInternal.tsx @@ -142,7 +142,7 @@ export const useSubmitInputInternal = () => { setTextAreaSensitiveMode(false); setTimeout(async () => { - const params = {prevPath: getPrevPath(), goToPath, setTextAreaValue, userInput, + const params = {prevPath: getPrevPath(), currPath: getCurrPath(), goToPath, setTextAreaValue, userInput, injectMessage, streamMessage, removeMessage, endStreamMessage, openChat, showToast, dismissToast }; const hasNextPath = await postProcessBlock(flowRef.current as Flow, path, params, goToPath); diff --git a/src/types/Params.ts b/src/types/Params.ts index f81a9c19..449aad51 100644 --- a/src/types/Params.ts +++ b/src/types/Params.ts @@ -5,6 +5,7 @@ import { Flow } from "./Flow"; */ export type Params = { userInput: string; + currPath: keyof Flow | null; prevPath: keyof Flow | null; goToPath: (pathToGo: keyof Flow) => void; setTextAreaValue: (value: string) => void;