Skip to content

Commit

Permalink
Use uuid library instead of self.crypto.randomUUID() to prevent crash…
Browse files Browse the repository at this point in the history
… in non-secure context (#107)
  • Loading branch information
StreetLamb authored Aug 7, 2024
1 parent fc71c02 commit 376fd99
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
31 changes: 31 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"react-markdown": "^9.0.1",
"react-query": "3.39.3",
"reactflow": "^11.11.1",
"uuid": "^10.0.0",
"zustand": "4.5.0"
},
"devDependencies": {
Expand All @@ -38,6 +39,7 @@
"@types/node": "20.10.5",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@types/uuid": "^10.0.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"openapi-typescript-codegen": "0.25.0",
"typescript": "^5.2.2",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Teams/ChatTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { IoCreateOutline } from "react-icons/io5"
import { FaCheck, FaTimes } from "react-icons/fa"
import { fetchEventSource } from "@microsoft/fetch-event-source"
import { FiCopy } from "react-icons/fi"
import { v4 } from "uuid"

// possible message types: "ai" | "human" | "tool" | "error" | "interrupt"

Expand Down Expand Up @@ -366,7 +367,7 @@ const ChatTeam = () => {
...prev,
{
type: "human",
id: self.crypto.randomUUID(),
id: v4(),
content: data.messages[0].content,
name: "user",
},
Expand Down

0 comments on commit 376fd99

Please sign in to comment.