doFetchClaimListMine: add 4th param to filter out claim_type

This commit is contained in:
infiinte-persistence 2021-03-15 18:04:55 +08:00 committed by Sean Yesmunt
parent f449d7916c
commit e5b79a8400

View file

@ -65,7 +65,7 @@ export function doResolveUris(
} = {}; } = {};
return Lbry.resolve({ urls: urisToResolve, ...options }).then( return Lbry.resolve({ urls: urisToResolve, ...options }).then(
async(result: ResolveResponse) => { async (result: ResolveResponse) => {
let repostedResults = {}; let repostedResults = {};
const repostsToResolve = []; const repostsToResolve = [];
const fallbackResolveInfo = { const fallbackResolveInfo = {
@ -140,18 +140,24 @@ export function doResolveUri(uri: string) {
export function doFetchClaimListMine( export function doFetchClaimListMine(
page: number = 1, page: number = 1,
pageSize: number = 99999, pageSize: number = 99999,
resolve: boolean = true resolve: boolean = true,
filterBy: Array<string> = []
) { ) {
return (dispatch: Dispatch) => { return (dispatch: Dispatch) => {
dispatch({ dispatch({
type: ACTIONS.FETCH_CLAIM_LIST_MINE_STARTED, type: ACTIONS.FETCH_CLAIM_LIST_MINE_STARTED,
}); });
let claimTypes = ['stream', 'repost'];
if (filterBy && filterBy.length !== 0) {
claimTypes = claimTypes.filter(t => filterBy.includes(t));
}
// $FlowFixMe // $FlowFixMe
Lbry.claim_list({ Lbry.claim_list({
page: page, page: page,
page_size: pageSize, page_size: pageSize,
claim_type: ['stream', 'repost'], claim_type: claimTypes,
resolve, resolve,
}).then((result: StreamListResponse) => { }).then((result: StreamListResponse) => {
dispatch({ dispatch({