From 438cde0ab82cf9fdbdcbb45e0ad8e43efc3525bb Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 31 Mar 2019 17:40:44 +0200 Subject: hide pdf --- scraper/client/paper/paper.verify.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'scraper') diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index 83eb5b44..fcebac02 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -60,6 +60,7 @@ class PaperVerify extends Component { ...initialState, ...citationState, ...address.paper, + pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)), } this.setState(newState) } else if (verify && !verify.loading && verify.paper && (!oldPaper || oldPaper !== verify.paper)) { @@ -70,6 +71,7 @@ class PaperVerify extends Component { ...initialState, ...citationState, ...address.paper, + pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)), } this.setState(newState) } else { @@ -79,6 +81,7 @@ class PaperVerify extends Component { newState = { ...citationState, ...address.paper, + pdfIndex: citationState.citations.pdf.findIndex(el => el.pdf.match(/^http:/)), uses_dataset: paper.uses_dataset, images_in_paper: paper.images_in_paper, verified_by: paper.verified_by, @@ -156,7 +159,7 @@ class PaperVerify extends Component { if (citationIndex < 0) { history.push('/paper/' + key + '/info/') } else { - let nextId = citations[citationIndex].id + let nextId = sortedCitations[citationIndex].id history.push('/paper/' + key + '/verify/' + nextId) } } @@ -172,10 +175,10 @@ class PaperVerify extends Component { history.push('/paper/' + key + '/info/') } else { citationIndex += 1 - if (citationIndex >= citations.length) { + if (citationIndex >= sortedCitations.length) { history.push('/paper/' + key + '/info/') } else { - let nextId = citations[citationIndex].id + let nextId = sortedCitations[citationIndex].id history.push('/paper/' + key + '/verify/' + nextId) } } @@ -414,7 +417,10 @@ class PaperVerify extends Component { >{'Next >'} -