Skip to content

Commit

Permalink
fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Sep 16, 2024
1 parent 8d91269 commit 293a31a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composables/state/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const isDark = useDark()

const isAppearanceTransition =
typeof document !== 'undefined' &&
document.startViewTransition &&
!!document.startViewTransition &&
!window.matchMedia('(prefers-reduced-motion: reduce)').matches

/**
Expand All @@ -21,7 +21,7 @@ export function toggleDark(event?: MouseEvent) {
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
)
// @ts-expect-error: Transition API

const transition = document.startViewTransition(async () => {
isDark.value = !isDark.value
await nextTick()
Expand Down

0 comments on commit 293a31a

Please sign in to comment.