Merge pull request #284 from lbryio/myclaims-return-canonical

use canonical_url when returning own claim urls and fix lint
This commit is contained in:
Sean Yesmunt 2020-03-09 07:35:05 -07:00 committed by GitHub
commit 9009708fff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 12 deletions

10
dist/bundle.es.js vendored
View file

@ -2206,7 +2206,7 @@ const selectMyClaimUrisWithoutChannels = reselect.createSelector(selectMyClaimsW
} else { } else {
return b.timestamp - a.timestamp; return b.timestamp - a.timestamp;
} }
}).map(claim => `lbry://${claim.name}#${claim.claim_id}`)); }).map(claim => claim.canonical_url));
const selectAllMyClaimsByOutpoint = reselect.createSelector(selectMyClaimsRaw, claims => new Set(claims && claims.length ? claims.map(claim => `${claim.txid}:${claim.nout}`) : null)); const selectAllMyClaimsByOutpoint = reselect.createSelector(selectMyClaimsRaw, claims => new Set(claims && claims.length ? claims.map(claim => `${claim.txid}:${claim.nout}`) : null));
@ -2920,6 +2920,7 @@ function doFetchClaimListMine(page = 1, pageSize = 99999, resolve = true) {
type: FETCH_CLAIM_LIST_MINE_STARTED type: FETCH_CLAIM_LIST_MINE_STARTED
}); });
// $FlowFixMe
lbryProxy.claim_list({ page, page_size: pageSize, claim_type: ['stream', 'repost'], resolve }).then(result => { lbryProxy.claim_list({ page, page_size: pageSize, claim_type: ['stream', 'repost'], resolve }).then(result => {
const claims = result.items; const claims = result.items;
@ -4210,14 +4211,11 @@ from, isBackgroundSearch = false, options = {}, nsfw) => (dispatch, getState) =>
return; return;
} }
const optionsWithFrom = _extends$8({ const optionsWithFrom = _extends$8({}, size ? { size } : {}, from ? { from } : {}, {
size,
from,
isBackgroundSearch isBackgroundSearch
}, options); }, options);
const optionsWithoutFrom = _extends$8({ const optionsWithoutFrom = _extends$8({}, size ? { size } : {}, {
size,
isBackgroundSearch isBackgroundSearch
}, options); }, options);

View file

@ -104,6 +104,7 @@ export function doFetchClaimListMine(
type: ACTIONS.FETCH_CLAIM_LIST_MINE_STARTED, type: ACTIONS.FETCH_CLAIM_LIST_MINE_STARTED,
}); });
// $FlowFixMe
Lbry.claim_list({ page, page_size: pageSize, claim_type: ['stream', 'repost'], resolve }).then( Lbry.claim_list({ page, page_size: pageSize, claim_type: ['stream', 'repost'], resolve }).then(
(result: StreamListResponse) => { (result: StreamListResponse) => {
const claims = result.items; const claims = result.items;

View file

@ -184,14 +184,14 @@ export const doResolvedSearch = (
} }
const optionsWithFrom: SearchOptions = { const optionsWithFrom: SearchOptions = {
size, ...(size ? { size } : {}),
from, ...(from ? { from } : {}),
isBackgroundSearch, isBackgroundSearch,
...options, ...options,
}; };
const optionsWithoutFrom: SearchOptions = { const optionsWithoutFrom: SearchOptions = {
size, ...(size ? { size } : {}),
isBackgroundSearch, isBackgroundSearch,
...options, ...options,
}; };

View file

@ -290,8 +290,8 @@ export const makeSelectDateForUri = (uri: string) =>
(claim.value.release_time (claim.value.release_time
? claim.value.release_time * 1000 ? claim.value.release_time * 1000
: claim.meta && claim.meta.creation_timestamp : claim.meta && claim.meta.creation_timestamp
? claim.meta.creation_timestamp * 1000 ? claim.meta.creation_timestamp * 1000
: null); : null);
if (!timestamp) { if (!timestamp) {
return undefined; return undefined;
} }
@ -377,7 +377,7 @@ export const selectMyClaimUrisWithoutChannels = createSelector(
return b.timestamp - a.timestamp; return b.timestamp - a.timestamp;
} }
}) })
.map(claim => `lbry://${claim.name}#${claim.claim_id}`) .map(claim => claim.canonical_url)
); );
export const selectAllMyClaimsByOutpoint = createSelector( export const selectAllMyClaimsByOutpoint = createSelector(