mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
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:
1 parent
2962a110f6
commit
e77eb4f43e
1 file changed
+2
-1
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user