From 41d10218337e6d21fd0473d451ce8fc1337afbbe Mon Sep 17 00:00:00 2001 From: jessop Date: Wed, 25 Sep 2019 17:16:27 -0400 Subject: [PATCH] off by 1 modifications --- dist/bundle.es.js | 12 ++++++------ src/redux/selectors/claims.js | 6 +++--- src/redux/selectors/file_info.js | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 798a3b2..31792c8 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1842,9 +1842,9 @@ const selectUpdatingChannel = reselect.createSelector(selectState$2, state => st const selectUpdateChannelError = reselect.createSelector(selectState$2, state => state.updateChannelError); -const makeSelectMyStreamUrisForPage = (page = 0) => reselect.createSelector(selectMyClaimUrisWithoutChannels, uris => { - const start = Number(page) * Number(PAGE_SIZE); - const end = (Number(page) + 1) * Number(PAGE_SIZE); +const makeSelectMyStreamUrisForPage = (page = 1) => reselect.createSelector(selectMyClaimUrisWithoutChannels, uris => { + const start = (Number(page) - 1) * Number(PAGE_SIZE); + const end = Number(page) * Number(PAGE_SIZE); return uris && uris.length ? uris.slice(start, end) : []; }); @@ -2714,9 +2714,9 @@ const makeSelectFileNameForUri = uri => reselect.createSelector(makeSelectFileIn return fileInfo && fileInfo.file_name; }); -const makeSelectDownloadUrisForPage = (page = 0) => reselect.createSelector(selectDownloadedUris, uris => { - const start = Number(page) * Number(PAGE_SIZE); - const end = (Number(page) + 1) * Number(PAGE_SIZE); +const makeSelectDownloadUrisForPage = (page = 1) => reselect.createSelector(selectDownloadedUris, uris => { + const start = (Number(page) - 1) * Number(PAGE_SIZE); + const end = Number(page) * Number(PAGE_SIZE); return uris && uris.length ? uris.slice(start, end) : []; }); diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index 23785df..eb9757a 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -592,12 +592,12 @@ export const selectUpdateChannelError = createSelector( state => state.updateChannelError ); -export const makeSelectMyStreamUrisForPage = (page: number = 0) => +export const makeSelectMyStreamUrisForPage = (page: number = 1) => createSelector( selectMyClaimUrisWithoutChannels, uris => { - const start = (Number(page) * Number(PAGE_SIZE)); - const end = ((Number(page) + 1) * Number(PAGE_SIZE)); + const start = ((Number(page) - 1) * Number(PAGE_SIZE)); + const end = (Number(page) * Number(PAGE_SIZE)); return (uris && uris.length) ? uris.slice(start, end) : []; diff --git a/src/redux/selectors/file_info.js b/src/redux/selectors/file_info.js index f9d209f..484b3fd 100644 --- a/src/redux/selectors/file_info.js +++ b/src/redux/selectors/file_info.js @@ -204,12 +204,12 @@ export const makeSelectFileNameForUri = uri => } ); -export const makeSelectDownloadUrisForPage = (page = 0) => +export const makeSelectDownloadUrisForPage = (page = 1) => createSelector( selectDownloadedUris, uris => { - const start = (Number(page) * Number(PAGE_SIZE)); - const end = ((Number(page) + 1) * Number(PAGE_SIZE)); + const start = ((Number(page) - 1) * Number(PAGE_SIZE)); + const end = (Number(page) * Number(PAGE_SIZE)); return (uris && uris.length) ? uris.slice(start, end) : [];