From 06546e3f86b7c7af5af0e98150e544f1cd3f43f1 Mon Sep 17 00:00:00 2001 From: Lev Gorodetskiy Date: Wed, 20 Apr 2022 23:08:46 +0400 Subject: Fix Fold Results toggle --- src/web/src/components/Search/Response.js | 7 +++++-- src/web/src/components/Search/Search.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/web') 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 { this.toggleFolded()} + onClick={this.toggleFolded} /> {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 ? -- cgit v1.2.3