Skip to content

Commit

Permalink
fix: prevent view-transition in the same slide
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 10, 2024
1 parent 688e9cf commit 205e42c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/client/composables/useViewTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useViewTransition() {
const toMeta = getSlide(to.params.no as string)?.meta
const fromNo = fromMeta?.slide?.no
const toNo = toMeta?.slide?.no
const transitionType = fromNo != null && toNo != null
const transitionType = fromNo != null && toNo != null && fromNo !== toNo
&& ((fromNo < toNo ? fromMeta?.transition : toMeta?.transition) ?? configs.transition)
if (transitionType !== 'view-transition') {
isViewTransition.value = false
Expand All @@ -41,7 +41,6 @@ export function useViewTransition() {

// Wait for `TransitionGroup` to become normal `div`
setTimeout(() => {
// @ts-expect-error missing types
document.startViewTransition(() => {
changeRoute()
return promise
Expand Down

0 comments on commit 205e42c

Please sign in to comment.