From 63313cf8d7954f533c2b5dd954a3f6406fc57d17 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 22 Mar 2019 11:16:56 +0100 Subject: prev btn --- scraper/client/paper/paper.verify.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'scraper/client/paper') diff --git a/scraper/client/paper/paper.verify.js b/scraper/client/paper/paper.verify.js index 8cb14d84..98692588 100644 --- a/scraper/client/paper/paper.verify.js +++ b/scraper/client/paper/paper.verify.js @@ -99,6 +99,24 @@ class PaperVerify extends Component { this.next(false) } + prev() { + const { key } = this.props.api.paperInfo.dataset + const { paperInfo } = this.props.api + let citationIndex = (paperInfo.citations || []) + .findIndex(f => f.id === this.state.citation.id) + if (citationIndex === -1) { + history.push('/paper/' + key + '/info/') + } else { + citationIndex -= 1 + if (citationIndex < 0) { + history.push('/paper/' + key + '/info/') + } else { + let nextId = paperInfo.citations[citationIndex].id + history.push('/paper/' + key + '/verify/' + nextId) + } + } + } + next() { const { key } = this.props.api.paperInfo.dataset const { paperInfo } = this.props.api @@ -226,6 +244,11 @@ class PaperVerify extends Component { ref={ref => this.button = ref} >Save Verification + +