From ee2fa8546b9620c156bbb36d5131a2369950629e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 2 Apr 2019 19:38:55 +0200 Subject: fix --- scraper/client/paper/paper.verify.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scraper') diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index 8794feb4..813abb6d 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -36,7 +36,9 @@ class PaperVerify extends Component { const { sha256 } = this.props.match.params this.props.actions.getInstitutions() this.props.actions.getAddress(sha256) - this.props.actions.getVerification(this.props.api.paperInfo.dataset.key, sha256) + if (this.props.api.paperInfo.dataset) { + this.props.actions.getVerification(this.props.api.paperInfo.dataset.key, sha256) + } const citationState = this.getCitationState(sha256) // console.log('DID MOUNT') this.setState(citationState) @@ -51,6 +53,10 @@ class PaperVerify extends Component { const paper = verify ? verify.paper : null let newState = {} + if (this.props.api.paperInfo.dataset !== oldProps.api.paperInfo.dataset) { + this.props.actions.getVerification(this.props.api.paperInfo.dataset.key, sha256) + } + if (oldSha256 && sha256 !== oldSha256) { // console.log('update verification') this.props.actions.getAddress(sha256) -- cgit v1.2.3-70-g09d2