🐛 (web) Dynamic first host avatar not displaying in viewer
This commit is contained in:
@@ -86,31 +86,30 @@ export const ConversationContainer = (props: Props) => {
|
||||
onMount(() => {
|
||||
;(async () => {
|
||||
const initialChunk = chatChunks()[0]
|
||||
if (initialChunk.clientSideActions) {
|
||||
const actionsBeforeFirstBubble = initialChunk.clientSideActions.filter(
|
||||
(action) => isNotDefined(action.lastBubbleBlockId)
|
||||
if (!initialChunk.clientSideActions) return
|
||||
const actionsBeforeFirstBubble = initialChunk.clientSideActions.filter(
|
||||
(action) => isNotDefined(action.lastBubbleBlockId)
|
||||
)
|
||||
for (const action of actionsBeforeFirstBubble) {
|
||||
if (
|
||||
'streamOpenAiChatCompletion' in action ||
|
||||
'webhookToExecute' in action
|
||||
)
|
||||
for (const action of actionsBeforeFirstBubble) {
|
||||
if (
|
||||
'streamOpenAiChatCompletion' in action ||
|
||||
'webhookToExecute' in action
|
||||
)
|
||||
setIsSending(true)
|
||||
const response = await executeClientSideAction({
|
||||
clientSideAction: action,
|
||||
context: {
|
||||
apiHost: props.context.apiHost,
|
||||
sessionId: props.initialChatReply.sessionId,
|
||||
},
|
||||
onMessageStream: streamMessage,
|
||||
})
|
||||
if (response && 'replyToSend' in response) {
|
||||
sendMessage(response.replyToSend, response.logs)
|
||||
return
|
||||
}
|
||||
if (response && 'blockedPopupUrl' in response)
|
||||
setBlockedPopupUrl(response.blockedPopupUrl)
|
||||
setIsSending(true)
|
||||
const response = await executeClientSideAction({
|
||||
clientSideAction: action,
|
||||
context: {
|
||||
apiHost: props.context.apiHost,
|
||||
sessionId: props.initialChatReply.sessionId,
|
||||
},
|
||||
onMessageStream: streamMessage,
|
||||
})
|
||||
if (response && 'replyToSend' in response) {
|
||||
sendMessage(response.replyToSend, response.logs)
|
||||
return
|
||||
}
|
||||
if (response && 'blockedPopupUrl' in response)
|
||||
setBlockedPopupUrl(response.blockedPopupUrl)
|
||||
}
|
||||
})()
|
||||
})
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Avatar = (props: { initialAvatarSrc?: string }) => {
|
||||
|
||||
createEffect(() => {
|
||||
if (
|
||||
avatarSrc()?.startsWith('{{') &&
|
||||
(avatarSrc()?.startsWith('{{') || !avatarSrc()) &&
|
||||
props.initialAvatarSrc?.startsWith('http')
|
||||
)
|
||||
setAvatarSrc(props.initialAvatarSrc)
|
||||
|
||||
Reference in New Issue
Block a user