diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-03-28 15:27:56 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-03-28 15:27:56 +0100 |
| commit | 3bad596c05c8305d327955225d3d10aacce78da1 (patch) | |
| tree | bfc7788a60d13fbcdcea71313aeebdc6ea69a05f /scraper/client/common/autocomplete.component.js | |
| parent | ad6284a2040837e7373b4d89644a01306f181dd5 (diff) | |
add paper addresses to unverified papers
Diffstat (limited to 'scraper/client/common/autocomplete.component.js')
| -rw-r--r-- | scraper/client/common/autocomplete.component.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scraper/client/common/autocomplete.component.js b/scraper/client/common/autocomplete.component.js index e2908cd1..a619e2c8 100644 --- a/scraper/client/common/autocomplete.component.js +++ b/scraper/client/common/autocomplete.component.js @@ -49,6 +49,10 @@ class Autocomplete extends Component { componentDidMount() { // build index based on what's in the hierarchy + if (!this.props.institutions.loading) this.buildIndex() + } + + buildIndex() { const { entities, lookup } = this.props.institutions let index = [] this.index = index @@ -69,6 +73,9 @@ class Autocomplete extends Component { } componentDidUpdate(oldProps) { + if (oldProps.institutions.loading && !this.props.institutions.loading) { + this.buildIndex() + } if (this.props.vetting !== oldProps.vetting) { this.handleChange({ target: { value: this.props.vetting } }) } else if (this.props.value !== oldProps.value) { |
