fix: crypto undefined on some websites, leading to session creation failure (#231)

This commit is contained in:
josc146
2023-04-20 22:12:08 +08:00
parent 8af03398d5
commit 4fb5d735ea
6 changed files with 24 additions and 9 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next'
import DeleteButton from '../DeleteButton'
import { useConfig } from '../../hooks/use-config.mjs'
import { createSession } from '../../config/localSession.mjs'
import { v4 as uuidv4 } from 'uuid'
const logo = Browser.runtime.getURL('logo.png')
@@ -306,7 +307,7 @@ function ConversationCard(props) {
...session,
sessionName: new Date().toLocaleString(),
autoClean: false,
sessionId: crypto.randomUUID(),
sessionId: uuidv4(),
}
setSession(newSession)
createSession(newSession).then(() =>