Skip to content

Commit cb547dd

Browse files
committed
fix(web): satisfy effect lint
1 parent c61aaf9 commit cb547dd

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

packages/app/src/web/actions-projects.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,15 @@ const resolveProjectTerminalKey = (
7979
return null
8080
}
8181

82-
type ProjectCrypto = Crypto & {
83-
readonly randomUUID?: () => string
84-
}
85-
8682
const randomHex = (bytes: number): string => {
8783
const values = new Uint8Array(bytes)
8884
globalThis.crypto.getRandomValues(values)
8985
return Array.from(values, (value) => value.toString(16).padStart(2, "0")).join("")
9086
}
9187

9288
const createPendingTerminalSessionId = (): string => {
93-
const crypto = globalThis.crypto as ProjectCrypto
94-
if (typeof crypto.randomUUID === "function") {
95-
return crypto.randomUUID()
89+
if (Reflect.has(globalThis.crypto, "randomUUID")) {
90+
return globalThis.crypto.randomUUID()
9691
}
9792

9893
return `pending-${Date.now().toString(16)}-${randomHex(8)}`

0 commit comments

Comments
 (0)