From 3bad596c05c8305d327955225d3d10aacce78da1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 28 Mar 2019 15:27:56 +0100 Subject: add paper addresses to unverified papers --- scraper/client/common/autocomplete.component.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scraper/client/common/autocomplete.component.js') 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) { -- cgit v1.2.3-70-g09d2