🐛 Fix progress bar crash when input is undefined
This commit is contained in:
@ -113,7 +113,7 @@ export const continueChat = publicProcedure
|
||||
: computeCurrentProgress({
|
||||
typebotsQueue: newSessionState.typebotsQueue,
|
||||
progressMetadata: newSessionState.progressMetadata,
|
||||
currentInputBlockId: input?.id as string,
|
||||
currentInputBlockId: input?.id,
|
||||
})
|
||||
: undefined,
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ export const startChat = publicProcedure
|
||||
: computeCurrentProgress({
|
||||
typebotsQueue: newSessionState.typebotsQueue,
|
||||
progressMetadata: newSessionState.progressMetadata,
|
||||
currentInputBlockId: input?.id as string,
|
||||
currentInputBlockId: input?.id,
|
||||
})
|
||||
: undefined,
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ export const startChatPreview = publicProcedure
|
||||
: computeCurrentProgress({
|
||||
typebotsQueue: newSessionState.typebotsQueue,
|
||||
progressMetadata: newSessionState.progressMetadata,
|
||||
currentInputBlockId: input?.id as string,
|
||||
currentInputBlockId: input?.id,
|
||||
})
|
||||
: undefined,
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import { Block, SessionState } from '@typebot.io/schemas'
|
||||
type Props = {
|
||||
typebotsQueue: SessionState['typebotsQueue']
|
||||
progressMetadata: NonNullable<SessionState['progressMetadata']>
|
||||
currentInputBlockId: string
|
||||
currentInputBlockId: string | undefined
|
||||
}
|
||||
|
||||
export const computeCurrentProgress = ({
|
||||
@ -13,6 +13,7 @@ export const computeCurrentProgress = ({
|
||||
progressMetadata,
|
||||
currentInputBlockId,
|
||||
}: Props) => {
|
||||
if (!currentInputBlockId) return
|
||||
const paths = computePossibleNextInputBlocks({
|
||||
typebotsQueue: typebotsQueue,
|
||||
blockId: currentInputBlockId,
|
||||
|
Reference in New Issue
Block a user