Fix delete option broken / missing

This commit is contained in:
saltrafael 2021-08-10 14:51:05 -03:00 committed by Thomas Zarebczan
parent cc3600631e
commit 445566c915
3 changed files with 4 additions and 24 deletions

View file

@ -8,6 +8,7 @@ import {
makeSelectCollectionIsMine, makeSelectCollectionIsMine,
COLLECTIONS_CONSTS, COLLECTIONS_CONSTS,
makeSelectEditedCollectionForId, makeSelectEditedCollectionForId,
makeSelectClaimIsMine,
} from 'lbry-redux'; } from 'lbry-redux';
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked'; import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked'; import { doChannelMute, doChannelUnmute } from 'redux/actions/blocked';
@ -24,7 +25,6 @@ import {
makeSelectChannelIsAdminBlocked, makeSelectChannelIsAdminBlocked,
} from 'redux/selectors/comments'; } from 'redux/selectors/comments';
import { doToast } from 'redux/actions/notifications'; import { doToast } from 'redux/actions/notifications';
import { makeSelectSigningIsMine } from 'redux/selectors/content';
import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions'; import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions'; import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
import { selectUserVerifiedEmail } from 'redux/selectors/user'; import { selectUserVerifiedEmail } from 'redux/selectors/user';
@ -45,7 +45,7 @@ const select = (state, props) => {
contentClaim, contentClaim,
contentSigningChannel, contentSigningChannel,
contentChannelUri, contentChannelUri,
claimIsMine: makeSelectSigningIsMine(props.uri)(state), claimIsMine: makeSelectClaimIsMine(props.uri)(state),
hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl( hasClaimInWatchLater: makeSelectCollectionForIdHasClaimUrl(
COLLECTIONS_CONSTS.WATCH_LATER_ID, COLLECTIONS_CONSTS.WATCH_LATER_ID,
contentPermanentUri contentPermanentUri

View file

@ -5,13 +5,13 @@ import {
doResolveUri, doResolveUri,
makeSelectClaimForUri, makeSelectClaimForUri,
makeSelectIsAbandoningClaimForUri, makeSelectIsAbandoningClaimForUri,
makeSelectClaimIsMine,
} from 'lbry-redux'; } from 'lbry-redux';
import { doHideModal } from 'redux/actions/app'; import { doHideModal } from 'redux/actions/app';
import ModalRemoveFile from './view'; import ModalRemoveFile from './view';
import { makeSelectSigningIsMine } from 'redux/selectors/content';
const select = (state, props) => ({ const select = (state, props) => ({
claimIsMine: makeSelectSigningIsMine(props.uri)(state), claimIsMine: makeSelectClaimIsMine(props.uri)(state),
title: makeSelectTitleForUri(props.uri)(state), title: makeSelectTitleForUri(props.uri)(state),
claim: makeSelectClaimForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state),
isAbandoning: makeSelectIsAbandoningClaimForUri(props.uri)(state), isAbandoning: makeSelectIsAbandoningClaimForUri(props.uri)(state),

View file

@ -11,8 +11,6 @@ import {
parseURI, parseURI,
makeSelectContentTypeForUri, makeSelectContentTypeForUri,
makeSelectFileNameForUri, makeSelectFileNameForUri,
normalizeURI,
selectMyActiveClaims,
selectClaimIdsByUri, selectClaimIdsByUri,
} from 'lbry-redux'; } from 'lbry-redux';
import { makeSelectRecommendedContentForUri } from 'redux/selectors/search'; import { makeSelectRecommendedContentForUri } from 'redux/selectors/search';
@ -247,24 +245,6 @@ export const makeSelectInsufficientCreditsForUri = (uri: string) =>
} }
); );
export const makeSelectSigningIsMine = (rawUri: string) => {
let uri;
try {
uri = normalizeURI(rawUri);
} catch (e) {}
return createSelector(selectClaimsByUri, selectMyActiveClaims, (claims, myClaims) => {
try {
parseURI(uri);
} catch (e) {
return false;
}
const signingChannel = claims && claims[uri] && (claims[uri].signing_channel || claims[uri]);
return signingChannel && myClaims.has(signingChannel.claim_id);
});
};
export const makeSelectRecommendationId = (claimId: string) => export const makeSelectRecommendationId = (claimId: string) =>
createSelector(selectState, (state) => state.recommendationId[claimId]); createSelector(selectState, (state) => state.recommendationId[claimId]);