fix myPurchases selector
This commit is contained in:
parent
910b55f059
commit
aa2cfa7896
3 changed files with 13 additions and 2 deletions
7
dist/bundle.es.js
vendored
7
dist/bundle.es.js
vendored
|
@ -2313,6 +2313,11 @@ const makeSelectMyPurchasesForPage = (query, page = 1) => reselect.createSelecto
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!query) {
|
||||||
|
// ensure no duplicates from double purchase bugs
|
||||||
|
return [...new Set(myPurchases)];
|
||||||
|
}
|
||||||
|
|
||||||
const fileInfos = myPurchases.map(uri => claimsByUri[uri]);
|
const fileInfos = myPurchases.map(uri => claimsByUri[uri]);
|
||||||
const matchingFileInfos = filterClaims(fileInfos, query);
|
const matchingFileInfos = filterClaims(fileInfos, query);
|
||||||
const start = (Number(page) - 1) * Number(PAGE_SIZE);
|
const start = (Number(page) - 1) * Number(PAGE_SIZE);
|
||||||
|
@ -3752,7 +3757,7 @@ function doClearRepostError() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function doPurchaseList(page = 1, pageSize = 99999) {
|
function doPurchaseList(page = 1, pageSize = PAGE_SIZE) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: PURCHASE_LIST_STARTED
|
type: PURCHASE_LIST_STARTED
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { selectSupportsByOutpoint } from 'redux/selectors/wallet';
|
||||||
import { creditsToString } from 'util/format-credits';
|
import { creditsToString } from 'util/format-credits';
|
||||||
import { batchActions } from 'util/batch-actions';
|
import { batchActions } from 'util/batch-actions';
|
||||||
import { createNormalizedClaimSearchKey } from 'util/claim';
|
import { createNormalizedClaimSearchKey } from 'util/claim';
|
||||||
|
import { PAGE_SIZE } from 'constants/claim';
|
||||||
|
|
||||||
export function doResolveUris(uris: Array<string>, returnCachedClaims: boolean = false) {
|
export function doResolveUris(uris: Array<string>, returnCachedClaims: boolean = false) {
|
||||||
return (dispatch: Dispatch, getState: GetState) => {
|
return (dispatch: Dispatch, getState: GetState) => {
|
||||||
|
@ -630,7 +631,7 @@ export function doClearRepostError() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function doPurchaseList(page: number = 1, pageSize: number = 99999) {
|
export function doPurchaseList(page: number = 1, pageSize: number = PAGE_SIZE) {
|
||||||
return (dispatch: Dispatch) => {
|
return (dispatch: Dispatch) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: ACTIONS.PURCHASE_LIST_STARTED,
|
type: ACTIONS.PURCHASE_LIST_STARTED,
|
||||||
|
|
|
@ -260,6 +260,11 @@ export const makeSelectMyPurchasesForPage = (query: ?string, page: number = 1) =
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!query) {
|
||||||
|
// ensure no duplicates from double purchase bugs
|
||||||
|
return [...new Set(myPurchases)];
|
||||||
|
}
|
||||||
|
|
||||||
const fileInfos = myPurchases.map(uri => claimsByUri[uri]);
|
const fileInfos = myPurchases.map(uri => claimsByUri[uri]);
|
||||||
const matchingFileInfos = filterClaims(fileInfos, query);
|
const matchingFileInfos = filterClaims(fileInfos, query);
|
||||||
const start = (Number(page) - 1) * Number(PAGE_SIZE);
|
const start = (Number(page) - 1) * Number(PAGE_SIZE);
|
||||||
|
|
Loading…
Reference in a new issue