fix(assistant): use uuidv4 for chat ID generation (#37462)

* fix(assistant-state): replace crypto.randomUUID with uuidv4 for chat ID generation

* fix format
This commit is contained in:
varshith257 authored and GitHub committed 2025-07-25 17:40:18 +02:00
1 parent 2962a110f6
commit e77eb4f43e
1 file changed
+2 -1
+2 -1
View File
@@ -2,6 +2,7 @@ import type { Message as MessageType } from 'ai/react'
import { DBSchema, IDBPDatabase, openDB } from 'idb'
import { debounce } from 'lodash'
import { createContext, PropsWithChildren, useContext, useEffect, useState } from 'react'
import { v4 as uuidv4 } from 'uuid'
import { proxy, snapshot, subscribe, useSnapshot } from 'valtio'
import { LOCAL_STORAGE_KEYS } from 'common'
@@ -234,7 +235,7 @@ export const createAiAssistantState = (): AiAssistantState => {
Pick<AiAssistantData, 'open' | 'initialInput' | 'sqlSnippets' | 'suggestions' | 'tables'>
>
) => {
const chatId = crypto.randomUUID()
const chatId = uuidv4()
const newChat: ChatSession = {
id: chatId,
name: options?.name ?? 'Untitled',