diff --git a/ui/component/claimUri/index.js b/ui/component/claimUri/index.js index 976000481..16e3fff04 100644 --- a/ui/component/claimUri/index.js +++ b/ui/component/claimUri/index.js @@ -1,10 +1,10 @@ import { connect } from 'react-redux'; -import { makeSelectCanonicalUrlForUri } from 'redux/selectors/claims'; +import { selectCanonicalUrlForUri } from 'redux/selectors/claims'; import { doToast } from 'redux/actions/notifications'; import ClaimUri from './view'; const select = (state, props) => ({ - shortUrl: makeSelectCanonicalUrlForUri(props.uri)(state), + shortUrl: selectCanonicalUrlForUri(state, props.uri), }); export default connect(select, { diff --git a/ui/component/subscribeButton/index.js b/ui/component/subscribeButton/index.js index 7d9ae272f..ddca5268c 100644 --- a/ui/component/subscribeButton/index.js +++ b/ui/component/subscribeButton/index.js @@ -5,7 +5,7 @@ import { selectFirstRunCompleted, makeSelectNotificationsDisabled, } from 'redux/selectors/subscriptions'; -import { makeSelectPermanentUrlForUri } from 'redux/selectors/claims'; +import { selectPermanentUrlForUri } from 'redux/selectors/claims'; import { selectUser } from 'redux/selectors/user'; import { doToast } from 'redux/actions/notifications'; import SubscribeButton from './view'; @@ -13,7 +13,7 @@ import SubscribeButton from './view'; const select = (state, props) => ({ isSubscribed: selectIsSubscribedForUri(state, props.uri), firstRunCompleted: selectFirstRunCompleted(state), - permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state), + permanentUrl: selectPermanentUrlForUri(state, props.uri), notificationsDisabled: makeSelectNotificationsDisabled(props.uri)(state), user: selectUser(state), }); diff --git a/ui/page/invited/index.js b/ui/page/invited/index.js index 2d5478eed..29a3d5581 100644 --- a/ui/page/invited/index.js +++ b/ui/page/invited/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import InvitedPage from './view'; -import { makeSelectPermanentUrlForUri } from 'redux/selectors/claims'; +import { selectPermanentUrlForUri } from 'redux/selectors/claims'; import { withRouter } from 'react-router'; const select = (state, props) => { @@ -10,7 +10,7 @@ const select = (state, props) => { const sanitizedReferrer = referrer ? referrer.replace(':', '#') : ''; const uri = `lbry://${sanitizedReferrer}`; return { - fullUri: makeSelectPermanentUrlForUri(uri)(state), + fullUri: selectPermanentUrlForUri(state, uri), referrer: referrer, }; }; diff --git a/ui/redux/selectors/claims.js b/ui/redux/selectors/claims.js index e4c25786f..8c00eaf34 100644 --- a/ui/redux/selectors/claims.js +++ b/ui/redux/selectors/claims.js @@ -647,14 +647,20 @@ export const selectClaimSearchByQueryLastPageReached = createSelector( (state) => state.claimSearchByQueryLastPageReached || {} ); -export const makeSelectShortUrlForUri = (uri: string) => - createSelector(makeSelectClaimForUri(uri), (claim) => claim && claim.short_url); +export const selectShortUrlForUri = (state: State, uri: string) => { + const claim = selectClaimForUri(state, uri); + return claim && claim.short_url; +}; -export const makeSelectCanonicalUrlForUri = (uri: string) => - createSelector(makeSelectClaimForUri(uri), (claim) => claim && claim.canonical_url); +export const selectCanonicalUrlForUri = (state: State, uri: string) => { + const claim = selectClaimForUri(state, uri); + return claim && claim.canonical_url; +}; -export const makeSelectPermanentUrlForUri = (uri: string) => - createSelector(makeSelectClaimForUri(uri), (claim) => claim && claim.permanent_url); +export const selectPermanentUrlForUri = (state: State, uri: string) => { + const claim = selectClaimForUri(state, uri); + return claim && claim.permanent_url; +}; export const makeSelectSupportsForUri = (uri: string) => createSelector(selectSupportsByOutpoint, makeSelectClaimForUri(uri), (byOutpoint, claim: ?StreamClaim) => {