fix subsequent searches on search page.

This commit is contained in:
Akinwale Ariwodola 2019-12-29 11:10:33 +01:00
parent d538838921
commit f7c8bf3949

View file

@ -88,8 +88,8 @@ class SearchPage extends React.PureComponent {
} }
} }
allContentResolved() { allContentResolved(props) {
const { uris, resolvingUris } = this.props; const { uris, resolvingUris } = props;
if (!this.state.resultsResolved) { if (!this.state.resultsResolved) {
return false; return false;
} }
@ -104,9 +104,9 @@ class SearchPage extends React.PureComponent {
return false; return false;
} }
shouldComponentUpdate() { shouldComponentUpdate(nextProps) {
const { isSearching, uris } = this.props; const { isSearching, uris } = this.props;
return (isSearching && (!uris || uris.length === 0)) || (!isSearching && this.allContentResolved()); return (isSearching && (!uris || uris.length === 0)) || (!isSearching && this.allContentResolved(this.props));
} }
componentDidUpdate() { componentDidUpdate() {
@ -135,6 +135,7 @@ class SearchPage extends React.PureComponent {
claimSearchOptions: null, claimSearchOptions: null,
claimSearchRun: false, claimSearchRun: false,
showTagResult: false, showTagResult: false,
resultsResolved: false,
}); });
search(keywords); search(keywords);
}; };