persist request/folder uids after request/folder resequencing and ui updates (#4611)

* move file/folder uids to new paths

* drag file/folder preview ui updates, can item be dropped ui hint check

---------

Co-authored-by: lohit <lohit@usebruno.com>
This commit is contained in:
lohit
2025-05-06 22:20:59 +05:30
committed by GitHub
parent 38c307d6f1
commit 2ee7ce5829
12 changed files with 152 additions and 33 deletions

View File

@@ -324,6 +324,25 @@ const removePath = async (source) => {
}
}
// Recursively gets paths.
const getPaths = async (source) => {
let paths = [];
const _getPaths = async (source) => {
const stat = await fsPromises.lstat(source);
paths.push(source);
if (stat.isDirectory()) {
const entries = await fsPromises.readdir(source);
for (const entry of entries) {
const entryPath = path.join(source, entry);
await _getPaths(entryPath);
}
}
}
await _getPaths(source);
return paths;
}
module.exports = {
isValidPathname,
exists,
@@ -352,5 +371,6 @@ module.exports = {
safeWriteFile,
safeWriteFileSync,
copyPath,
removePath
removePath,
getPaths
};