Files
ysj7705 69b647145f
CI / Type-check & Build (push) Failing after 5m50s
CI / Build & Push image (push) Skipped
first commit
2026-08-12 15:01:43 +09:00

15 lines
399 B
TypeScript

import { useLocalStorage } from '@vueuse/core'
export function useClientId() {
const clientId = useLocalStorage('sejong.clientId', '')
if (import.meta.client && !clientId.value) {
clientId.value =
typeof crypto !== 'undefined' && crypto.randomUUID
? crypto.randomUUID()
: `client-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
}
return { clientId }
}