From 9e7d14d4c8bd701828b5b29df2c3cc3341394501 Mon Sep 17 00:00:00 2001 From: maltempi Date: Fri, 15 Feb 2019 22:43:21 -0200 Subject: [PATCH] Fixing pagination --- Packages-react/ohif-viewer/src/sha.js | 2 +- .../ohif-viewer/src/studylist/StudyListWithData.js | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Packages-react/ohif-viewer/src/sha.js b/Packages-react/ohif-viewer/src/sha.js index 4f0d60e2f..bf332a624 100644 --- a/Packages-react/ohif-viewer/src/sha.js +++ b/Packages-react/ohif-viewer/src/sha.js @@ -1 +1 @@ -export default '6b6237cdf6e54b87ccfb69efed769bc75e6fe232'; +export default '993b50e3bce2cc6f007212aea6d0ace66543226b'; diff --git a/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js b/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js index b6e78c5cd..9d338d315 100644 --- a/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js +++ b/Packages-react/ohif-viewer/src/studylist/StudyListWithData.js @@ -14,6 +14,7 @@ class StudyListWithData extends Component { state = { searchData: {}, studies: null, + studyCount: 0, error: null }; @@ -58,9 +59,7 @@ class StudyListWithData extends Component { modalitiesInStudy: searchData.modalitiesInStudy, studyDateFrom: searchData.studyDateFrom, studyDateTo: searchData.studyDateTo, - limit: - searchData.currentPage * searchData.rowsPerPage + - searchData.rowsPerPage, + limit: searchData.rowsPerPage, offset: searchData.currentPage * searchData.rowsPerPage }; @@ -83,7 +82,8 @@ class StudyListWithData extends Component { }); this.setState({ - studies: fixedStudies + studies: fixedStudies, + studyCount: fixedStudies.length }); }) .catch(error => { @@ -115,14 +115,12 @@ class StudyListWithData extends Component { return
Loading...
; } - const studyCount = this.state.studies ? this.state.studies.length : 0; - return ( <>