aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Search/Response.jsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/web/src/components/Search/Response.jsx b/src/web/src/components/Search/Response.jsx
index 40029b0c..f665c816 100644
--- a/src/web/src/components/Search/Response.jsx
+++ b/src/web/src/components/Search/Response.jsx
@@ -83,11 +83,17 @@ class Response extends Component {
const oldTree = { ...this.state.tree };
const oldFiles = oldTree[directory];
- const { files, name } = await getDirectoryContents({
+ // some clients might send more than one directory in the response,
+ // if the requested directory contains subdirectories. the root directory
+ // is always first, and for now we'll only display the contents of that.
+ const allDirectories = await getDirectoryContents({
directory,
username,
});
+ const theRootDirectory = allDirectories?.[0];
+ const { files, name } = theRootDirectory;
+
// the api returns file names only, so we need to prepend the directory
// to make it look like a search result. we also need to preserve
// any file selections, so check the old files and assign accordingly