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

View file

@ -6,7 +6,7 @@ import {
selectClaimIsMine,
makeSelectClaimIsPending,
selectGeoRestrictionForUri,
selectLatestClaimByUri,
selectLatestClaimForUri,
} from 'redux/selectors/claims';
import {
makeSelectCollectionForId,
@ -41,7 +41,7 @@ const select = (state, props) => {
const { canonical_url: canonicalUrl, claim_id: claimId } = claim || {};
const latestContentClaim = liveContentPath
? selectActiveLiveClaimForChannel(state, claimId)
: selectLatestClaimByUri(state, canonicalUrl);
: selectLatestClaimForUri(state, canonicalUrl);
const latestClaimUrl = latestContentClaim && latestContentClaim.canonical_url;
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 selectLatestByUri = (state: State) => selectState(state).latestByUri;
export const selectLatestClaimByUri = createSelector(
export const selectLatestClaimForUri = createSelector(
(state, uri) => uri,
selectLatestByUri,
(uri, latestByUri) => {