const directory = computed<string>(
() => String(route.query.dir || '/')
// Remove any trailing slash but leave root slash
- .replace(/^(.+)\/$/, '$1')
+ .replace(/^(.+)\/$/, '$1'),
)
/**
/**
* 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 */