diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 39a32fb..b39425c 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -2881,10 +2881,10 @@ function doFetchChannelListMine(page = 1, pageSize = 99999) { type: FETCH_CHANNEL_LIST_STARTED }); - const callback = channels => { + const callback = response => { dispatch({ type: FETCH_CHANNEL_LIST_COMPLETED, - data: { claims: channels.items } + data: { claims: response.items } }); }; @@ -3017,7 +3017,7 @@ const selectFileListDownloadedSort = reselect.createSelector(selectState$3, stat const selectDownloadedUris = reselect.createSelector(selectFileInfosDownloaded, // We should use permament_url but it doesn't exist in file_list -info => info.slice().reverse().map(claim => `lbry://${claim.claim_name}#${claim.claim_id}`)); +info => info.slice().map(claim => `lbry://${claim.claim_name}#${claim.claim_id}`)); const makeSelectMediaTypeForUri = uri => reselect.createSelector(makeSelectFileInfoForUri(uri), makeSelectContentTypeForUri(uri), (fileInfo, contentType) => { if (!fileInfo && !contentType) { @@ -3068,7 +3068,11 @@ const makeSelectSearchDownloadUrlsForPage = (query, page = 1) => reselect.create const start = (Number(page) - 1) * Number(PAGE_SIZE); const end = Number(page) * Number(PAGE_SIZE); - return matchingFileInfos && matchingFileInfos.length ? matchingFileInfos.slice(start, end).map(fileInfo => buildURI({ streamName: fileInfo.claim_name, channelName: fileInfo.channel_name, channelClaimId: fileInfo.channel_claim_id })) : []; + return matchingFileInfos && matchingFileInfos.length ? matchingFileInfos.slice(start, end).map(fileInfo => buildURI({ + streamName: fileInfo.claim_name, + channelName: fileInfo.channel_name, + channelClaimId: fileInfo.channel_claim_id + })) : []; }); const makeSelectSearchDownloadUrlsCount = query => reselect.createSelector(selectFileInfosDownloaded, fileInfos => { diff --git a/dist/flow-typed/Lbry.js b/dist/flow-typed/Lbry.js index 047f9a0..006e170 100644 --- a/dist/flow-typed/Lbry.js +++ b/dist/flow-typed/Lbry.js @@ -215,11 +215,11 @@ declare type LbryTypes = { publish: (params: {}) => Promise, claim_search: (params: {}) => Promise, - claim_list: (params?: {}) => Promise, + claim_list: (params: {}) => Promise, channel_create: (params: {}) => Promise, channel_update: (params: {}) => Promise, channel_import: (params: {}) => Promise, - channel_list: (params?: {}) => Promise, + channel_list: (params: {}) => Promise, stream_abandon: (params: {}) => Promise, stream_list: (params: {}) => Promise, channel_abandon: (params: {}) => Promise, diff --git a/flow-typed/Lbry.js b/flow-typed/Lbry.js index 047f9a0..006e170 100644 --- a/flow-typed/Lbry.js +++ b/flow-typed/Lbry.js @@ -215,11 +215,11 @@ declare type LbryTypes = { publish: (params: {}) => Promise, claim_search: (params: {}) => Promise, - claim_list: (params?: {}) => Promise, + claim_list: (params: {}) => Promise, channel_create: (params: {}) => Promise, channel_update: (params: {}) => Promise, channel_import: (params: {}) => Promise, - channel_list: (params?: {}) => Promise, + channel_list: (params: {}) => Promise, stream_abandon: (params: {}) => Promise, stream_list: (params: {}) => Promise, channel_abandon: (params: {}) => Promise, diff --git a/src/redux/actions/claims.js b/src/redux/actions/claims.js index b61313b..1cacf65 100644 --- a/src/redux/actions/claims.js +++ b/src/redux/actions/claims.js @@ -388,10 +388,10 @@ export function doFetchChannelListMine(page: number = 1, pageSize: number = 9999 type: ACTIONS.FETCH_CHANNEL_LIST_STARTED, }); - const callback = (channels: ChannelListResponse) => { + const callback = (response: ChannelListResponse) => { dispatch({ type: ACTIONS.FETCH_CHANNEL_LIST_COMPLETED, - data: { claims: channels.items }, + data: { claims: response.items }, }); }; diff --git a/src/redux/selectors/file_info.js b/src/redux/selectors/file_info.js index 1431004..84374e8 100644 --- a/src/redux/selectors/file_info.js +++ b/src/redux/selectors/file_info.js @@ -146,11 +146,7 @@ export const selectFileListDownloadedSort = createSelector( export const selectDownloadedUris = createSelector( selectFileInfosDownloaded, // We should use permament_url but it doesn't exist in file_list - info => - info - .slice() - .reverse() - .map(claim => `lbry://${claim.claim_name}#${claim.claim_id}`) + info => info.slice().map(claim => `lbry://${claim.claim_name}#${claim.claim_id}`) ); export const makeSelectMediaTypeForUri = uri => @@ -214,9 +210,11 @@ function filterFileInfos(fileInfos, query) { const queryMatchRegExp = new RegExp(query, 'i'); return fileInfos.filter(fileInfo => { const { metadata } = fileInfo; - return (metadata.title && metadata.title.match(queryMatchRegExp)) || + return ( + (metadata.title && metadata.title.match(queryMatchRegExp)) || (fileInfo.channel_name && fileInfo.channel_name.match(queryMatchRegExp)) || - (fileInfo.claim_name && fileInfo.claim_name.match(queryMatchRegExp)); + (fileInfo.claim_name && fileInfo.claim_name.match(queryMatchRegExp)) + ); }); } @@ -228,22 +226,25 @@ export const makeSelectSearchDownloadUrlsForPage = (query, page = 1) => selectFileInfosDownloaded, fileInfos => { const matchingFileInfos = filterFileInfos(fileInfos, query); - const start = ((Number(page) - 1) * Number(PAGE_SIZE)); - const end = (Number(page) * Number(PAGE_SIZE)); + const start = (Number(page) - 1) * Number(PAGE_SIZE); + const end = Number(page) * Number(PAGE_SIZE); - return (matchingFileInfos && matchingFileInfos.length) + return matchingFileInfos && matchingFileInfos.length ? matchingFileInfos.slice(start, end).map(fileInfo => - buildURI({ streamName: fileInfo.claim_name, channelName: fileInfo.channel_name, channelClaimId: fileInfo.channel_claim_id })) + buildURI({ + streamName: fileInfo.claim_name, + channelName: fileInfo.channel_name, + channelClaimId: fileInfo.channel_claim_id, + }) + ) : []; } ); -export const makeSelectSearchDownloadUrlsCount = (query) => +export const makeSelectSearchDownloadUrlsCount = query => createSelector( selectFileInfosDownloaded, fileInfos => { - return fileInfos && fileInfos.length - ? filterFileInfos(fileInfos, query).length - : 0; + return fileInfos && fileInfos.length ? filterFileInfos(fileInfos, query).length : 0; } );