aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-04-13 15:20:53 -0500
committerJP Dillingham <jp@dillingham.me>2025-04-13 15:24:34 -0500
commit951b65d273fd4dcfe1508aabf2b5b4e833ecc0fa (patch)
tree917bccf09a38579025eaafa709819d5a524ff299 /src/web
parent860593e7f576cfe133cb594a331ceb87748af938 (diff)
downloadslskd-951b65d273fd4dcfe1508aabf2b5b4e833ecc0fa.tar.gz
shorten message
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/Search/Response.jsx27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/web/src/components/Search/Response.jsx b/src/web/src/components/Search/Response.jsx
index 079b91ba..0d94ee8c 100644
--- a/src/web/src/components/Search/Response.jsx
+++ b/src/web/src/components/Search/Response.jsx
@@ -83,21 +83,17 @@ class Response extends Component {
const oldTree = { ...this.state.tree };
const oldFiles = oldTree[directory];
- // 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,
- });
-
- // todo: deleteme
- console.log('allDirectories', allDirectories);
- console.log('allDirectoriesJson', JSON.stringify(allDirectories));
-
try {
+ // 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];
+ // some clients might send an empty response for some reason
if (!theRootDirectory) {
throw new Error('No directories were included in the response');
}
@@ -119,10 +115,9 @@ class Response extends Component {
oldTree[name] = fixedFiles;
this.setState({ tree: { ...oldTree } });
} catch (error) {
- throw new Error(
- `Failed to process the requested folder response: ${error}`,
- { cause: error },
- );
+ throw new Error(`Failed to process directory response: ${error}`, {
+ cause: error,
+ });
}
} catch (error) {
console.error(error);