@@ -22,6 +22,7 @@ import React, {
2222} from 'react' ;
2323import { User , ArrowDown , ChevronRight , ChevronDown , SquarePen } from 'lucide-react' ;
2424import { format } from 'date-fns' ;
25+ import { v4 as uuidv4 } from 'uuid' ;
2526import { TimeAgo } from '@/components/shared/TimeAgo' ;
2627import AssistantLogo from '@/components/AssistantLogo' ;
2728import { Tooltip , TooltipTrigger , TooltipContent } from '@/components/ui/tooltip' ;
@@ -455,7 +456,7 @@ export function AppBuilderChat({ organizationId }: AppBuilderChatProps) {
455456 const scrollContainerRef = useRef < HTMLDivElement > ( null ) ;
456457 const [ showScrollButton , setShowScrollButton ] = useState ( false ) ;
457458 const [ shouldAutoScroll , setShouldAutoScroll ] = useState ( true ) ;
458- const [ messageUuid , setMessageUuid ] = useState ( ( ) => crypto . randomUUID ( ) ) ;
459+ const [ messageUuid , setMessageUuid ] = useState ( ( ) => uuidv4 ( ) ) ;
459460 const [ selectedModel , setSelectedModel ] = useState < string > ( projectModel ?? '' ) ;
460461 const [ hasImages , setHasImages ] = useState ( false ) ;
461462 // Track the initial projectModel to detect when a new project loads
@@ -627,7 +628,7 @@ export function AppBuilderChat({ organizationId }: AppBuilderChatProps) {
627628 }
628629 manager . sendMessage ( value , images , selectedModel || undefined ) ;
629630 // PromptInput clears itself internally after successful submit
630- setMessageUuid ( crypto . randomUUID ( ) ) ;
631+ setMessageUuid ( uuidv4 ( ) ) ;
631632 } ,
632633 [ manager , selectedModel , pendingNewSession , sessions . length ]
633634 ) ;
0 commit comments