diff --git a/src/renderer/component/fileCard/index.js b/src/renderer/component/fileCard/index.js index 3754e3ffa..d210993d4 100644 --- a/src/renderer/component/fileCard/index.js +++ b/src/renderer/component/fileCard/index.js @@ -8,7 +8,10 @@ import { makeSelectClaimIsMine, } from 'lbry-redux'; import { doNavigate } from 'redux/actions/navigation'; -import { selectRewardContentClaimIds } from 'redux/selectors/content'; +import { + selectRewardContentClaimIds, + makeSelectContentPositionForUri, +} from 'redux/selectors/content'; import { selectShowNsfw } from 'redux/selectors/settings'; import { selectPendingPublish } from 'redux/selectors/publish'; import FileCard from './view'; @@ -32,6 +35,7 @@ const select = (state, props) => { rewardedContentClaimIds: selectRewardContentClaimIds(state, props), ...fileCardInfo, pending: !!pendingPublish, + position: makeSelectContentPositionForUri(props.uri)(state), }; }; diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx index f8dd8582c..ad95f0053 100644 --- a/src/renderer/component/fileCard/view.jsx +++ b/src/renderer/component/fileCard/view.jsx @@ -23,6 +23,7 @@ type Props = { claimIsMine: boolean, showPrice: boolean, pending?: boolean, + position: ?number, /* eslint-disable react/no-unused-prop-types */ resolveUri: string => void, isResolvingUri: boolean, @@ -61,6 +62,7 @@ class FileCard extends React.PureComponent { claimIsMine, showPrice, pending, + position, } = this.props; const shouldHide = !claimIsMine && !pending && obscureNsfw && metadata && metadata.nsfw; @@ -103,6 +105,7 @@ class FileCard extends React.PureComponent { {showPrice && } {isRewardContent && } {fileInfo && } + {position && } diff --git a/src/renderer/redux/selectors/content.js b/src/renderer/redux/selectors/content.js index ed73e59fe..0811f8e42 100644 --- a/src/renderer/redux/selectors/content.js +++ b/src/renderer/redux/selectors/content.js @@ -33,6 +33,9 @@ export const selectRewardContentClaimIds = createSelector( export const makeSelectContentPositionForUri = uri => createSelector(selectState, makeSelectClaimForUri(uri), (state, claim) => { + if (!claim) { + return null; + } const outpoint = `${claim.txid}:${claim.nout}`; const id = claim.claim_id; return state.positions[id] ? state.positions[id][outpoint] : null;