Use nanoid instead of uuid
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { nanoid } from "nanoid"
|
||||
import { useMemo } from "react"
|
||||
import { v4 as uuidv4 } from "uuid"
|
||||
|
||||
const storageKey = "sessionId"
|
||||
|
||||
@@ -12,7 +12,7 @@ export function useSessionId(): string | null {
|
||||
|
||||
let currentSessionId = sessionStorage.getItem(storageKey)
|
||||
if (!currentSessionId) {
|
||||
currentSessionId = uuidv4()
|
||||
currentSessionId = nanoid()
|
||||
sessionStorage.setItem(storageKey, currentSessionId)
|
||||
}
|
||||
return currentSessionId
|
||||
|
||||
Reference in New Issue
Block a user