foo
This commit is contained in:
+12
-4
@@ -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.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user