Skip to content
Merged
Changes from 1 commit
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
Next Next commit
fix(files): openfile is set on the query not as a param
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux committed Aug 3, 2024
commit 066bd0a25df42da93ead302c7258a962efee195f
7 changes: 5 additions & 2 deletions apps/files/src/composables/useRouteParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function useRouteParameters() {
const directory = computed<string>(
() => String(route.query.dir || '/')
// Remove any trailing slash but leave root slash
.replace(/^(.+)\/$/, '$1')
.replace(/^(.+)\/$/, '$1'),
)

/**
Expand All @@ -32,7 +32,10 @@ export function useRouteParameters() {
/**
* State of `openFile` route param
*/
const openFile = computed<boolean>(() => 'openFile' in route.params && route.params.openFile.toLocaleLowerCase() !== 'false')
const openFile = computed<boolean>(
// if `openfile` is set it is considered truthy, but allow to explicitly set it to 'false'
() => 'openfile' in route.query && (typeof route.query.openfile !== 'string' || route.query.openfile.toLocaleLowerCase() !== 'false'),
)

return {
/** Path of currently open directory */
Expand Down