fix: admin/fs: folder displayed as "." #782
Massimo Melina committed
Oct 18, 2024 at 09:55 UTC
d0a22206b8b1ccaf9ce601d0ac1e01049640dc2b
1 file changed
+1
-1
admin/src/VfsTree.ts
+1
-1
@@ -102,7 +102,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
102
isRoot ? "Home" : (() => { // special rendering if the whole source is not too long, and the name was not customized
103
const ps = node.parent?.source
104
const { source } = node
105
- const rel = ps && source?.startsWith(ps) ? '.' + source.slice(ps.length) : source
105
+ const rel = ps && source?.startsWith(ps) && source > ps ? '.' + source.slice(ps.length) : source
106
return !rel || !source?.endsWith(name) || rel.length > 45 ? name
107
: h('span', {},
108
h('span', { style: { opacity: .4, fontSize: 'small' } }, rel.slice(0,-name.length)),