Skip to content

Commit af9fda3

Browse files
fix: add optional chain to prevent nullish broken of currentRoute (#2208)
1 parent 48eb02f commit af9fda3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/client/composables/useNav.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ const useNavState = createSharedComposable((): SlidevContextNavState => {
277277

278278
const query = computed(() => {
279279
// eslint-disable-next-line ts/no-unused-expressions
280-
router.currentRoute.value.query
280+
router?.currentRoute?.value?.query
281281
return new URLSearchParams(location.search)
282282
})
283283
const isPrintMode = computed(() => query.value.has('print') || currentRoute.name === 'export')

0 commit comments

Comments
 (0)