diff --git a/packages/web-app-preview/src/App.vue b/packages/web-app-preview/src/App.vue index be49f921c32..215c8c82327 100644 --- a/packages/web-app-preview/src/App.vue +++ b/packages/web-app-preview/src/App.vue @@ -189,7 +189,7 @@ import { import AppTopBar from 'web-pkg/src/components/AppTopBar.vue' import { loadPreview } from 'web-pkg/src/helpers' import { configurationManager } from 'web-pkg/src/configuration' -import { createFileRouteOptions, mergeFileRouteOptions } from 'web-pkg/src/helpers/router' +import { createFileRouteOptions } from 'web-pkg/src/helpers/router' export const appId = 'preview' @@ -424,9 +424,9 @@ export default defineComponent({ }, // update route and url updateLocalHistory() { - const routeOptions = mergeFileRouteOptions( - this.$route, - createFileRouteOptions(unref(this.currentFileContext.space), this.activeFilteredFile) + const routeOptions = createFileRouteOptions( + unref(this.currentFileContext.space), + this.activeFilteredFile ) history.pushState({}, document.title, this.$router.resolve(routeOptions).href) }, diff --git a/packages/web-pkg/src/composables/router/useFileRouteReplace.ts b/packages/web-pkg/src/composables/router/useFileRouteReplace.ts index ba7c4dda48b..f4dd8dd51d5 100644 --- a/packages/web-pkg/src/composables/router/useFileRouteReplace.ts +++ b/packages/web-pkg/src/composables/router/useFileRouteReplace.ts @@ -1,10 +1,9 @@ import { useRouter } from './useRouter' import { useConfigurationManager } from '../configuration' import { Resource, SpaceResource } from 'web-client/src/helpers' -import { createFileRouteOptions, mergeFileRouteOptions } from '../../helpers/router' +import { createFileRouteOptions } from '../../helpers/router' import { Router } from 'vue-router' import { ConfigurationManager } from '../../configuration' -import { unref } from 'vue' export interface FileRouteReplaceOptions { router?: Router @@ -33,12 +32,9 @@ export const useFileRouteReplace = (options: FileRouteReplaceOptions = {}) => { return false } - const routeOptions = mergeFileRouteOptions( - unref(router.currentRoute), - createFileRouteOptions(space, resource, { - configurationManager - }) - ) + const routeOptions = createFileRouteOptions(space, resource, { + configurationManager + }) router.replace(routeOptions) return true } diff --git a/packages/web-pkg/src/composables/router/useRouteQuery.ts b/packages/web-pkg/src/composables/router/useRouteQuery.ts index 7b7ce5d152f..e2045275b2c 100644 --- a/packages/web-pkg/src/composables/router/useRouteQuery.ts +++ b/packages/web-pkg/src/composables/router/useRouteQuery.ts @@ -13,8 +13,8 @@ export const useRouteQuery = (name: string, defaultValue?: QueryValue): Ref { - return Object.assign({}, originalRoute, { - params: { - ...originalRoute.params, - ...routeOptions.params - }, - query: { - ...originalRoute.query, - ...routeOptions.query - } - }) -}