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
bcb4a676757e8735eeb4f9f4b8fb34e8b8eced2a
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() {