This commit is contained in:
2025-10-17 18:03:00 +02:00
parent f9e798f3b3
commit fc3d6cb826
9 changed files with 56 additions and 18 deletions
+12 -4
View File
@@ -1295,13 +1295,18 @@ const AppLayout = () => {
const ensureFolderData = useCallback(
async (folderId, { force = false } = {}) => {
async (folderId, { force = false, includeDocuments = true } = {}) => {
if (!force && folderContents.has(folderId)) {
return folderContents.get(folderId);
}
const path = folderId === 'root' ? 'root' : folderId;
const { data } = await api.get(`/folders/${path}/contents`);
const params = includeDocuments
? undefined
: { include_documents: false };
const { data } = await api.get(`/folders/${path}/contents`, {
params,
});
const hydrated = assetManager.hydrateFolderContents(data);
setFolderNodes((prev) => {
@@ -1363,7 +1368,10 @@ const AppLayout = () => {
visited.add(nextId);
try {
const contents = await ensureFolderData(nextId, { force: false });
const contents = await ensureFolderData(nextId, {
force: false,
includeDocuments: false,
});
const subfolders = Array.isArray(contents?.subfolders) ? contents.subfolders : [];
subfolders.forEach((entry) => {
if (entry?.id && !visited.has(entry.id)) {
@@ -4090,7 +4098,7 @@ const AppLayout = () => {
const node = folderNodes.get(folderId);
if (node && !node.loaded) {
try {
await ensureFolderData(folderId);
await ensureFolderData(folderId, { includeDocuments: false });
} catch (error) {
notifyApiError(error, 'Failed to load folder.');
}