import { LOCALSTORAGE_KEY_USER_UUID } from '@/constants/localStorageKeys'

export function getUserUuid(): string {
  let userUuid = localStorage.getItem(LOCALSTORAGE_KEY_USER_UUID)
  if (!userUuid) {
    userUuid = crypto.randomUUID()
    localStorage.setItem(LOCALSTORAGE_KEY_USER_UUID, userUuid)
  }
  return userUuid
}
