fix: random 404s (#6138)

* fix: random 404s when navigating from user, org, or collection page to project

* more

* revert server

* clean names

* prepr
This commit is contained in:
Prospector
2026-05-19 11:11:48 -07:00
committed by GitHub
parent f106dc580f
commit 302b60d89c
45 changed files with 127 additions and 123 deletions
@@ -529,8 +529,8 @@ const returnLink = computed(() => {
return null
})
const collectionId = computed(() => route.params.id)
const isFollowingCollection = computed(() => collectionId.value === 'following')
const collectionId = useRouteId('collection')
const isFollowingCollection = computed(() => collectionId === 'following')
// Static collection for "following" page
const followingCollection = computed(() =>
@@ -555,15 +555,15 @@ const {
error: collectionError,
isPending: collectionIsPending,
} = useQuery({
queryKey: computed(() => ['collection', collectionId.value]),
queryFn: () => api.labrinth.collections.get(collectionId.value),
enabled: computed(() => !!collectionId.value && !isFollowingCollection.value),
queryKey: computed(() => ['collection', collectionId]),
queryFn: () => api.labrinth.collections.get(collectionId),
enabled: computed(() => !!collectionId && !isFollowingCollection.value),
})
watch(
collectionError,
(error) => {
if (error && collectionId.value && !isFollowingCollection.value) {
if (error && collectionId && !isFollowingCollection.value) {
const status = error.statusCode ?? error.status ?? 404
showError({
fatal: true,