aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLev Gorodetskiy <github@droserasprout.space>2022-04-20 23:08:46 +0400
committerLev Gorodetskiy <github@droserasprout.space>2022-04-21 14:41:53 +0400
commit06546e3f86b7c7af5af0e98150e544f1cd3f43f1 (patch)
tree8ec59bbfede615f0451792083ca8d49f995a9907 /src
parent3d7474c8dd8fef6cb96bed2b8ac7b638bac08d34 (diff)
downloadslskd-06546e3f86b7c7af5af0e98150e544f1cd3f43f1.tar.gz
Fix Fold Results toggle
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Search/Response.js7
-rw-r--r--src/web/src/components/Search/Search.js2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/web/src/components/Search/Response.js b/src/web/src/components/Search/Response.js
index 0cb60586..996d491a 100644
--- a/src/web/src/components/Search/Response.js
+++ b/src/web/src/components/Search/Response.js
@@ -29,13 +29,16 @@ class Response extends Component {
tree: buildTree(this.props.response),
downloadRequest: undefined,
downloadError: '',
- isFolded: this.props.isFolded,
+ isFolded: this.props.isInitiallyFolded,
}
componentDidUpdate = (prevProps) => {
if (JSON.stringify(this.props.response) !== JSON.stringify(prevProps.response)) {
this.setState({ tree: buildTree(this.props.response) });
}
+ if (this.props.isInitiallyFolded !== prevProps.isInitiallyFolded) {
+ this.setState({ isFolded: this.props.isInitiallyFolded });
+ }
}
onFileSelectionChange = (file, state) => {
@@ -79,7 +82,7 @@ class Response extends Component {
<Icon
link
name={isFolded ? 'chevron right' : 'chevron down'}
- onClick={() => this.toggleFolded()}
+ onClick={this.toggleFolded}
/>
<Icon name='circle' color={free ? 'green' : 'yellow'}/>
{response.username}
diff --git a/src/web/src/components/Search/Search.js b/src/web/src/components/Search/Search.js
index 88d70c85..3dbcc939 100644
--- a/src/web/src/components/Search/Search.js
+++ b/src/web/src/components/Search/Search.js
@@ -284,7 +284,7 @@ class Search extends Component {
response={r}
onDownload={this.props.onDownload}
onHide={() => this.hideResult(r)}
- isFolded={foldResults}
+ isInitiallyFolded={foldResults}
/>
)}
{remainingCount > 0 ?