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'
export const executeGroup =
(state: SessionState, currentReply?: ChatReply) =>
(
state: SessionState,
currentReply?: ChatReply,
currentLastBubbleId?: string
) =>
async (
group: Group
): Promise<ChatReply & { newSessionState: SessionState }> => {
@ -32,7 +36,7 @@ export const executeGroup =
currentReply?.clientSideActions
let logs: ChatReply['logs'] = currentReply?.logs
let nextEdgeId = null
let lastBubbleBlockId: string | undefined
let lastBubbleBlockId: string | undefined = currentLastBubbleId
let newSessionState = state
@ -97,11 +101,15 @@ export const executeGroup =
return { messages, newSessionState, clientSideActions, logs }
}
return executeGroup(newSessionState, {
messages,
clientSideActions,
logs,
})(nextGroup.group)
return executeGroup(
newSessionState,
{
messages,
clientSideActions,
logs,
},
lastBubbleBlockId
)(nextGroup.group)
}
const computeRuntimeOptions =