off by 1 modifications

This commit is contained in:
jessop 2019-09-25 17:16:27 -04:00
parent 2cdc43b271
commit 41d1021833
3 changed files with 12 additions and 12 deletions

12
dist/bundle.es.js vendored
View file

@ -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) : [];
});

View file

@ -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)
: [];

View file

@ -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)
: [];