fix: server-only project middleware (#5538)

* fix(navigation): use replaceState for project filters to prevent history pollution

* fix: add replace prop to NavTabs and enable it on project and discover pages

* style: run pnpm run fix on affected files

* enable NavTabs replace prop on collection, user, and org pages

* fix: guard project middleware on client

* fix: lint

---------

Co-authored-by: Calum H. (IMB11) <contact@cal.engineer>
Co-authored-by: Truman Gao <106889354+tdgao@users.noreply.github.com>
This commit is contained in:
Mingxuan Ding
2026-03-17 06:09:43 +08:00
committed by GitHub
parent 681ae5d1d8
commit 1848ba3b29

View File

@@ -18,6 +18,8 @@ const PROJECT_TYPES = [
]
export default defineNuxtRouteMiddleware(async (to) => {
// Only run this middleware on the server - it relies on server-only runtime config
if (import.meta.client) return
// Only handle project routes
if (!to.params.id || !PROJECT_TYPES.includes(to.params.type as string)) {
return