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

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