Skip to content

Commit 2fd1959

Browse files
committed
chore: apply coderabbitai suggestion
1 parent 6566b1b commit 2fd1959

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/plugins/view-transitions.client.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ export default defineNuxtPlugin(nuxtApp => {
4848
finishTransition = resolve
4949
})
5050

51-
let changeRoute: () => void
52-
const ready = new Promise<void>(resolve => (changeRoute = resolve))
51+
let changeRoute: () => void = () => {}
52+
const ready = new Promise<void>(resolve => {
53+
changeRoute = resolve
54+
})
5355

5456
try {
5557
transition = document.startViewTransition(() => {
@@ -60,8 +62,9 @@ export default defineNuxtPlugin(nuxtApp => {
6062
transition.finished.finally(resetTransitionState)
6163
await nuxtApp.callHook('page:view-transition:start', transition)
6264
} catch (err) {
65+
// oxlint-disable-next-line no-console -- error logging
6366
console.error('View Transition failed:', err)
64-
changeRoute!()
67+
changeRoute()
6568
finishTransition?.()
6669
resetTransitionState()
6770
}

0 commit comments

Comments
 (0)