Skip to content

Commit b08b19d

Browse files
committed
fix: route creation
1 parent 771b3d0 commit b08b19d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

app/pages/package-code/@[[org]]/[packageName]/v/[version]/[...filePath].vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ const breadcrumbs = computed(() => {
201201
// Navigation helper - build URL for a path
202202
function getCurrentCodeUrl(path?: string): string {
203203
return getCodeUrl({
204-
org: route.params.org,
205-
packageName: packageName.value,
206-
version: version.value!,
204+
...route.params,
207205
filePath: path,
208206
})
209207
}

app/pages/package/[[org]]/[name].vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { useModal } from '~/composables/useModal'
1818
import { useAtproto } from '~/composables/atproto/useAtproto'
1919
import { togglePackageLike } from '~/utils/atproto/likes'
2020
import { LinkBase } from '#components'
21+
import type { RouteLocationRaw } from 'vue-router'
2122
2223
defineOgImageComponent('Package', {
2324
name: () => packageName.value,
@@ -516,7 +517,7 @@ useSeoMeta({
516517
twitterDescription: () => pkg.value?.description ?? '',
517518
})
518519
519-
const linkCode = computed((): Parameters<typeof navigateTo>[0] | null => {
520+
const codeLink = computed((): RouteLocationRaw | null => {
520521
if (pkg.value == null || resolvedVersion.value == null) {
521522
return null
522523
}
@@ -535,10 +536,10 @@ const linkCode = computed((): Parameters<typeof navigateTo>[0] | null => {
535536
onKeyStroke(
536537
e => isKeyWithoutModifiers(e, '.') && !isEditableElement(e.target),
537538
e => {
538-
if (linkCode.value === null) return
539+
if (codeLink.value === null) return
539540
e.preventDefault()
540541
541-
navigateTo(linkCode.value)
542+
navigateTo(codeLink.value)
542543
},
543544
{ dedupe: true },
544545
)
@@ -674,9 +675,9 @@ onKeyStroke(
674675
{{ $t('package.links.docs') }}
675676
</LinkBase>
676677
<LinkBase
677-
v-if="linkCode"
678+
v-if="codeLink"
678679
variant="button-secondary"
679-
:to="linkCode"
680+
:to="codeLink"
680681
aria-keyshortcuts="."
681682
classicon="i-carbon:code"
682683
>

0 commit comments

Comments
 (0)