@samitouri / QOSami-HFS / commits / 9016f4ac

fix: admin/fs: don't suggest that you can drag a folder to its own parent

Massimo Melina committed Sep 29, 2024 at 00:02 UTC 9016f4acd66679ec3605434e6e949ceb9ed6df54
1 file changed +1 -1
admin/src/VfsTree.ts
+1 -1
@@ -65,7 +65,7 @@ export default function VfsTree({ id2node, statusApi }:{ id2node: Map<string, Vf
65 onDragOver(ev) {
66 if (!folder) return
67 const src = dragging.current
68 - if (src?.startsWith(id) && !src.slice(id.length + 1).includes('/')) return // src must be not me or my parent
68 + if (src?.startsWith(id) && !src.slice(id.length + 1, -1).includes('/')) return // dragging node (src) must not be direct child of destination (id)
69 ev.preventDefault()
70 },
71 async onDrop() {