Fix selector naming convention

ByUri - returns the storage variable (array or object).
ForUri - returns the specific entry in the storage variable.
This commit is contained in:
infinite-persistence 2022-05-19 13:10:37 +08:00
parent f245f09d1c
commit 64225d2b80
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
3 changed files with 5 additions and 5 deletions

View file

@ -5,7 +5,7 @@ import {
selectClaimForUri, selectClaimForUri,
selectIsUriResolving, selectIsUriResolving,
selectGeoRestrictionForUri, selectGeoRestrictionForUri,
selectLatestClaimByUri, selectLatestClaimForUri,
} from 'redux/selectors/claims'; } from 'redux/selectors/claims';
import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info'; import { makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
import { doResolveUri, doFetchLatestClaimForChannel } from 'redux/actions/claims'; import { doResolveUri, doFetchLatestClaimForChannel } from 'redux/actions/claims';
@ -51,7 +51,7 @@ const select = (state, props) => {
const latestContentClaim = const latestContentClaim =
featureParam === PAGES.LIVE_NOW featureParam === PAGES.LIVE_NOW
? selectActiveLiveClaimForChannel(state, claimId) ? selectActiveLiveClaimForChannel(state, claimId)
: selectLatestClaimByUri(state, canonicalUrl); : selectLatestClaimForUri(state, canonicalUrl);
const latestClaimUrl = latestContentClaim && latestContentClaim.canonical_url; const latestClaimUrl = latestContentClaim && latestContentClaim.canonical_url;
if (latestClaimUrl) uri = latestClaimUrl; if (latestClaimUrl) uri = latestClaimUrl;

View file

@ -6,7 +6,7 @@ import {
selectClaimIsMine, selectClaimIsMine,
makeSelectClaimIsPending, makeSelectClaimIsPending,
selectGeoRestrictionForUri, selectGeoRestrictionForUri,
selectLatestClaimByUri, selectLatestClaimForUri,
} from 'redux/selectors/claims'; } from 'redux/selectors/claims';
import { import {
makeSelectCollectionForId, makeSelectCollectionForId,
@ -41,7 +41,7 @@ const select = (state, props) => {
const { canonical_url: canonicalUrl, claim_id: claimId } = claim || {}; const { canonical_url: canonicalUrl, claim_id: claimId } = claim || {};
const latestContentClaim = liveContentPath const latestContentClaim = liveContentPath
? selectActiveLiveClaimForChannel(state, claimId) ? selectActiveLiveClaimForChannel(state, claimId)
: selectLatestClaimByUri(state, canonicalUrl); : selectLatestClaimForUri(state, canonicalUrl);
const latestClaimUrl = latestContentClaim && latestContentClaim.canonical_url; const latestClaimUrl = latestContentClaim && latestContentClaim.canonical_url;
return { return {

View file

@ -35,7 +35,7 @@ export const selectRepostLoading = (state: State) => selectState(state).repostLo
export const selectRepostError = (state: State) => selectState(state).repostError; export const selectRepostError = (state: State) => selectState(state).repostError;
export const selectLatestByUri = (state: State) => selectState(state).latestByUri; export const selectLatestByUri = (state: State) => selectState(state).latestByUri;
export const selectLatestClaimByUri = createSelector( export const selectLatestClaimForUri = createSelector(
(state, uri) => uri, (state, uri) => uri,
selectLatestByUri, selectLatestByUri,
(uri, latestByUri) => { (uri, latestByUri) => {