mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +00:00
fix(webui): support version switching on public share (no login redirect)
Switching a version in the public share breadcrumb navigated to the authenticated /projects/:id/files/:id route, which triggered the authenticated /api/projects/:id/team call (via resolveTeamIdFromPath) -> 401 -> redirect to login. - breadcrumb handleVersionClick now routes to /share/:shareId/files/:id with a version search param when public. - public share route gains a version param; PublicShareManager fetches the stack asset (for the version list) and the active version child asset (for display/comments/fields), mirroring the authenticated page. - compare exit sets version to the active side for parity.
This commit is contained in:
@@ -94,7 +94,16 @@ export function BreadcrumbNav({
|
||||
const { canEdit } = usePermissions(projectId)
|
||||
|
||||
const handleVersionClick = (versionId: string) => {
|
||||
if (!projectId || !fileId) return
|
||||
if (!fileId) return
|
||||
if (isPublic && shareId) {
|
||||
navigate({
|
||||
to: '/share/$shareId/files/$fileId',
|
||||
params: { shareId, fileId },
|
||||
search: (prev: Record<string, unknown>) => ({ ...prev, version: versionId }),
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!projectId) return
|
||||
navigate({
|
||||
to: '/projects/$projectId/files/$fileId',
|
||||
params: { projectId, fileId },
|
||||
|
||||
Reference in New Issue
Block a user