2
0

🐛 Use position fixed for bubble

This commit is contained in:
Baptiste Arnaud
2023-02-21 14:29:53 +01:00
parent ab43d809c3
commit 527dc8a5b1
9 changed files with 115 additions and 81 deletions

View File

@ -89,6 +89,15 @@ export const ConversationContainer = (props: Props) => {
groupId: data.input.groupId,
})
}
if (data.clientSideActions) {
const actionsToExecute = data.clientSideActions.filter((action) =>
isNotDefined(action.lastBubbleBlockId)
)
for (const action of actionsToExecute) {
const response = await executeClientSideAction(action)
if (response) setBlockedPopupUrl(response.blockedPopupUrl)
}
}
setChatChunks((displayedChunks) => [
...displayedChunks,
{
@ -109,15 +118,6 @@ export const ConversationContainer = (props: Props) => {
const handleAllBubblesDisplayed = async () => {
const lastChunk = chatChunks().at(-1)
if (!lastChunk) return
if (lastChunk.clientSideActions) {
const actionsToExecute = lastChunk.clientSideActions.filter((action) =>
isNotDefined(action.lastBubbleBlockId)
)
for (const action of actionsToExecute) {
const response = await executeClientSideAction(action)
if (response) setBlockedPopupUrl(response.blockedPopupUrl)
}
}
if (isNotDefined(lastChunk.input)) {
props.onEnd?.()
}