Skip to content

Commit b6f319c

Browse files
committed
fix: do not watch twice
1 parent 03848f2 commit b6f319c

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

app/pages/code/[...path].vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ function switchVersion(newVersion: string) {
8989
const { data: fileTree, status: treeStatus } = useFetch<PackageFileTreeResponse>(
9090
() => `/api/registry/files/${packageName.value}/v/${version.value}`,
9191
{
92-
watch: [packageName, version],
9392
immediate: !!version.value,
9493
},
9594
)
@@ -134,10 +133,7 @@ const fileContentUrl = computed(() => {
134133
135134
const { data: fileContent, status: fileStatus } = useFetch<PackageFileContentResponse>(
136135
() => fileContentUrl.value!,
137-
{
138-
watch: [fileContentUrl],
139-
immediate: !!fileContentUrl.value,
140-
},
136+
{ immediate: !!fileContentUrl.value },
141137
)
142138
143139
// Track hash manually since we update it via history API to avoid scroll

0 commit comments

Comments
 (0)