Skip to content

Commit

Permalink
chore: use a simple random string generator
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Dec 30, 2024
1 parent 8f8468a commit f97e60e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/shared/useBodyScrollLock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { type Fn, isClient, isIOS, tryOnBeforeUnmount } from '@vueuse/shared'
import { computed, nextTick, ref, watch } from 'vue'
import { defu } from 'defu'
import { injectConfigProviderContext } from '@/ConfigProvider/ConfigProvider.vue'
import { useId } from './useId'

const useBodyLockStackCount = createSharedComposable(() => {
const map = ref<Map<string, boolean>>(new Map())
Expand Down Expand Up @@ -89,7 +88,7 @@ const useBodyLockStackCount = createSharedComposable(() => {
})

export function useBodyScrollLock(initialState?: boolean | undefined) {
const id = useId()
const id = Math.random().toString(36).substring(2, 7) // just simple random id, need not to be cryptographically secure
const map = useBodyLockStackCount()

map.value.set(id, initialState ?? false)
Expand Down

0 comments on commit f97e60e

Please sign in to comment.