Skip to content

Commit

Permalink
feat: navigate to personal space when closing created document
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Oct 17, 2024
1 parent 4ffdf38 commit 35af9cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions packages/web-app-external/src/extensions/createFromTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import {
ActionExtension,
contextRouteNameKey,
contextRouteParamsKey,
contextRouteQueryKey,
EDITOR_MODE_EDIT,
FileAction,
locationSpacesGeneric,
resolveFileNameDuplicate,
useAppProviderService,
useClientService,
Expand Down Expand Up @@ -96,6 +100,15 @@ export const useActionExtensionCreateFromTemplate = (): ActionExtension => {
undefined,
template.fileId
)
const contextRouteOptions = {
[contextRouteNameKey]: locationSpacesGeneric.name,
[contextRouteParamsKey]: { driveAliasAndItem: spacesStore.personalSpace.driveAlias },
[contextRouteQueryKey]: { fileId: spacesStore.personalSpace.fileId }
}
routeOptions.query = {
...routeOptions.query,
...contextRouteOptions
}
await router.push(routeOptions)
} catch (e) {
// TODO: can we get more specific with error titles?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export interface AppNavigationResult {
}

export const contextRouteNameKey = 'contextRouteName'
const contextRouteParamsKey = 'contextRouteParams'
const contextRouteQueryKey = 'contextRouteQuery'
export const contextRouteParamsKey = 'contextRouteParams'
export const contextRouteQueryKey = 'contextRouteQuery'

/*
vue-router type bindings do not allow nested objects
Expand Down

0 comments on commit 35af9cd

Please sign in to comment.