add selector for short_url

This commit is contained in:
Sean Yesmunt 2019-07-08 14:28:14 -04:00
parent c83489e78e
commit 66225f02c8
3 changed files with 13 additions and 1 deletions

3
dist/bundle.es.js vendored
View file

@ -1501,6 +1501,8 @@ const selectFetchingClaimSearch = reselect.createSelector(selectState$1, state =
const selectLastClaimSearchUris = reselect.createSelector(selectState$1, state => state.lastClaimSearchUris);
const makeSelectShortUrlForUri = uri => reselect.createSelector(makeSelectClaimForUri(uri), claim => console.log(claim) || claim && claim.short_url);
const selectState$2 = state => state.wallet || {};
const selectWalletState = selectState$2;
@ -4736,6 +4738,7 @@ exports.makeSelectPendingByUri = makeSelectPendingByUri;
exports.makeSelectQueryWithOptions = makeSelectQueryWithOptions;
exports.makeSelectRecommendedContentForUri = makeSelectRecommendedContentForUri;
exports.makeSelectSearchUris = makeSelectSearchUris;
exports.makeSelectShortUrlForUri = makeSelectShortUrlForUri;
exports.makeSelectStreamingUrlForUri = makeSelectStreamingUrlForUri;
exports.makeSelectTagsForUri = makeSelectTagsForUri;
exports.makeSelectThumbnailForUri = makeSelectThumbnailForUri;

View file

@ -169,6 +169,7 @@ export {
makeSelectClaimIsPending,
makeSelectPendingByUri,
makeSelectClaimsInChannelForCurrentPageState,
makeSelectShortUrlForUri,
selectPendingById,
selectClaimsById,
selectClaimsByUri,

View file

@ -195,7 +195,9 @@ export const makeSelectDateForUri = (uri: string) =>
claim.value &&
(claim.value.release_time
? claim.value.release_time * 1000
: (claim.meta.creation_timestamp ? claim.meta.creation_timestamp * 1000 : null));
: claim.meta.creation_timestamp
? claim.meta.creation_timestamp * 1000
: null);
if (!timestamp) {
return undefined;
}
@ -468,3 +470,9 @@ export const selectLastClaimSearchUris = createSelector(
selectState,
state => state.lastClaimSearchUris
);
export const makeSelectShortUrlForUri = (uri: string) =>
createSelector(
makeSelectClaimForUri(uri),
claim => console.log(claim) || (claim && claim.short_url)
);