2
0

🐛 (viewer) Fix client side action when in separate group

This commit is contained in:
Baptiste Arnaud
2023-03-02 14:37:09 +01:00
parent 4968ed4202
commit a1cf1e89e7

View File

@ -23,7 +23,11 @@ import { computePaymentInputRuntimeOptions } from '@/features/blocks/inputs/paym
import { injectVariableValuesInButtonsInputBlock } from '@/features/blocks/inputs/buttons/api/utils/injectVariableValuesInButtonsInputBlock' import { injectVariableValuesInButtonsInputBlock } from '@/features/blocks/inputs/buttons/api/utils/injectVariableValuesInButtonsInputBlock'
export const executeGroup = export const executeGroup =
(state: SessionState, currentReply?: ChatReply) => (
state: SessionState,
currentReply?: ChatReply,
currentLastBubbleId?: string
) =>
async ( async (
group: Group group: Group
): Promise<ChatReply & { newSessionState: SessionState }> => { ): Promise<ChatReply & { newSessionState: SessionState }> => {
@ -32,7 +36,7 @@ export const executeGroup =
currentReply?.clientSideActions currentReply?.clientSideActions
let logs: ChatReply['logs'] = currentReply?.logs let logs: ChatReply['logs'] = currentReply?.logs
let nextEdgeId = null let nextEdgeId = null
let lastBubbleBlockId: string | undefined let lastBubbleBlockId: string | undefined = currentLastBubbleId
let newSessionState = state let newSessionState = state
@ -97,11 +101,15 @@ export const executeGroup =
return { messages, newSessionState, clientSideActions, logs } return { messages, newSessionState, clientSideActions, logs }
} }
return executeGroup(newSessionState, { return executeGroup(
messages, newSessionState,
clientSideActions, {
logs, messages,
})(nextGroup.group) clientSideActions,
logs,
},
lastBubbleBlockId
)(nextGroup.group)
} }
const computeRuntimeOptions = const computeRuntimeOptions =