diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 5055500..be9be87 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -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; diff --git a/src/index.js b/src/index.js index 3202149..3c7c82f 100644 --- a/src/index.js +++ b/src/index.js @@ -169,6 +169,7 @@ export { makeSelectClaimIsPending, makeSelectPendingByUri, makeSelectClaimsInChannelForCurrentPageState, + makeSelectShortUrlForUri, selectPendingById, selectClaimsById, selectClaimsByUri, diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index afd084d..af42470 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -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) + );