fix(xo-web/file-restore): ensure folder path trailing slash (#3446)

This commit is contained in:
Pierre Donias 2018-09-24 10:52:48 +02:00 committed by Julien Fontanet
parent 99e6d54647
commit 4147800266
2 changed files with 5 additions and 1 deletions

View File

@ -6,6 +6,8 @@
### Bug fixes ### Bug fixes
[File restore] Fix a path issue when going back to the parent folder (PR [#3446](https://github.com/vatesfr/xen-orchestra/pull/3446))
### Released packages ### Released packages
- xo-server v5.28.0 - xo-server v5.28.0

View File

@ -46,6 +46,8 @@ const fileOptionRenderer = ({ isFile, name }) => (
</span> </span>
) )
const ensureTrailingSlash = path => path + (endsWith(path, '/') ? '' : '/')
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
const formatFilesOptions = (rawFiles, path) => { const formatFilesOptions = (rawFiles, path) => {
@ -56,7 +58,7 @@ const formatFilesOptions = (rawFiles, path) => {
id: '..', id: '..',
isFile: false, isFile: false,
name: '..', name: '..',
path: dirname(path), path: ensureTrailingSlash(dirname(path)),
}, },
] ]
: [] : []