diff options
| author | JP Dillingham <jp@dillingham.me> | 2025-04-12 17:16:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-12 17:16:46 -0500 |
| commit | 0e4e270f480ea667dd8406f33ddc512f737289d8 (patch) | |
| tree | 4084f3c9e90d4c0ab3b2c917aa9d7e092d021120 /src/web | |
| parent | 667991f4c969317fd8a35e9443e1f238e9303632 (diff) | |
| parent | 66c60cadfa300d88f1b66d9e4d6174803b18c3ef (diff) | |
| download | slskd-0e4e270f480ea667dd8406f33ddc512f737289d8.tar.gz | |
Merge pull request #1324 from slskd/directory-bugfix
Fix bug preventing full directory from being fetched while reviewing search results
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/Search/Response.jsx | 8 |
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 |
