From 4f2060723d9363100f65413397de170b15ee4f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Mon, 13 Jan 2025 09:16:45 +0100 Subject: [PATCH 1/2] fix: filter subtree children for only files. This will fix refresh file list --- src/resourcemgr/fileBrowser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resourcemgr/fileBrowser.js b/src/resourcemgr/fileBrowser.js index 1fd0c2ae..1f537ba5 100755 --- a/src/resourcemgr/fileBrowser.js +++ b/src/resourcemgr/fileBrowser.js @@ -127,7 +127,11 @@ export default function (options) { } if (root !== 'local' || !_.find(subTree.children, { name: file.name })) { updatePermissions(file); - if (subTree.children.length === subTree.total) { + const childrenFilesOnly = _.filter(subTree.children, function (child) { + return !child.hasOwnProperty('path'); + }); + + if (childrenFilesOnly.length === subTree.total) { // all children loaded new file can be pushed to the end of tree // if not all, new file will be loaded with next page subTree.children.push(file); From b50ef1c21216bc7b8ada17093559d53d7753af15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Marsza=C5=82?= Date: Mon, 13 Jan 2025 09:54:56 +0100 Subject: [PATCH 2/2] fix: apply ESLint --- src/resourcemgr/fileBrowser.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resourcemgr/fileBrowser.js b/src/resourcemgr/fileBrowser.js index 1f537ba5..b62185e4 100755 --- a/src/resourcemgr/fileBrowser.js +++ b/src/resourcemgr/fileBrowser.js @@ -128,7 +128,8 @@ export default function (options) { if (root !== 'local' || !_.find(subTree.children, { name: file.name })) { updatePermissions(file); const childrenFilesOnly = _.filter(subTree.children, function (child) { - return !child.hasOwnProperty('path'); + // Only file object has link property + return Object.prototype.hasOwnProperty.call(child, 'link'); }); if (childrenFilesOnly.length === subTree.total) {