fix: admin/fs: selection lost after renaming a folder

Massimo Melina committed Apr 16, 2023 at 16:14 UTC dafea95aa0867eb2b81cfb8e9517dfd5f58eeb90
1 file changed +1 -1
admin/src/FileForm.ts
+1 -1
@@ -94,7 +94,7 @@ export default function FileForm({ file, anyMask, defaultPerms, addToBar, urls }
94 props,
95 })
96 if (props.name !== file.name) // when the name changes, the id of the selected file is changing too, and we have to update it in the state if we want it to be correctly re-selected after reload
97 - state.selectedFiles[0].id = file.id.slice(0, -file.name.length) + props.name
97 + state.selectedFiles[0].id = file.parent!.id + props.name + (isDir ? '/' : '')
98 reloadVfs()
99 }
100 },