Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export const useFileRouteReplace = (options: FileRouteReplaceOptions = {}) => {
}

const routeOptions = createFileRouteOptions(space, resource, { configStore })
router.replace(routeOptions)
router.replace({
...routeOptions,
query: { ...router.currentRoute.value.query, ...routeOptions.query }
})
return true
}

Expand Down
3 changes: 2 additions & 1 deletion packages/web-runtime/src/pages/resolvePublicLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script setup lang="ts">
import { DavHttpError, PublicLinkType, SharePermissionBit } from '@opencloud-eu/web-client'
import { authService } from '../services/auth'
import { parsePathQuery } from '../router/helpers'

import {
queryItemAsString,
Expand Down Expand Up @@ -189,7 +190,7 @@ const resolvePublicLinkTask = useTask(function* (signal, passwordRequired: boole

const url = queryItemAsString(unref(redirectUrl))
if (url) {
router.push({ path: url })
router.push(parsePathQuery(url))
return
}

Expand Down
13 changes: 13 additions & 0 deletions packages/web-runtime/src/router/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ const getContextRoute = (router: Router, to: RouteLocation): RouteRecordNormaliz
return router.getRoutes().find((r) => r.name === to.query[contextRouteNameKey])
}

/**
* Splits a URL string into separate path and query parts for use with router.push().
* Vue Router's resolve() silently drops query params embedded in the path string,
* so they need to be passed via the query field explicitly.
*/
export const parsePathQuery = (url: string): { path: string; query?: Record<string, string> } => {
if (!url.includes('?')) {
return { path: url }
}
const [path, queryString] = url.split('?')
return { path, query: Object.fromEntries(new URLSearchParams(queryString)) }
}

const getRouteMeta = (to: RouteLocation): WebRouteMeta => {
if (!to.meta) {
return {
Expand Down