removes delete button and ensures resolve on show page
This commit is contained in:
parent
160015391e
commit
402710ce3b
4 changed files with 7 additions and 24 deletions
|
@ -30,8 +30,6 @@ type Props = {
|
||||||
showUnresolvedClaims?: boolean,
|
showUnresolvedClaims?: boolean,
|
||||||
renderProperties: ?(Claim) => Node,
|
renderProperties: ?(Claim) => Node,
|
||||||
includeSupportAction?: boolean,
|
includeSupportAction?: boolean,
|
||||||
includeOwnerActions?: boolean,
|
|
||||||
abandonActionCallback?: any => void,
|
|
||||||
hideBlock: boolean,
|
hideBlock: boolean,
|
||||||
injectedItem: ?Node,
|
injectedItem: ?Node,
|
||||||
timedOutMessage?: Node,
|
timedOutMessage?: Node,
|
||||||
|
@ -57,8 +55,6 @@ export default function ClaimList(props: Props) {
|
||||||
showUnresolvedClaims,
|
showUnresolvedClaims,
|
||||||
renderProperties,
|
renderProperties,
|
||||||
includeSupportAction,
|
includeSupportAction,
|
||||||
includeOwnerActions,
|
|
||||||
abandonActionCallback,
|
|
||||||
hideBlock,
|
hideBlock,
|
||||||
injectedItem,
|
injectedItem,
|
||||||
timedOutMessage,
|
timedOutMessage,
|
||||||
|
@ -152,8 +148,6 @@ export default function ClaimList(props: Props) {
|
||||||
uri={uri}
|
uri={uri}
|
||||||
type={type}
|
type={type}
|
||||||
includeSupportAction={includeSupportAction}
|
includeSupportAction={includeSupportAction}
|
||||||
includeOwnerActions={includeOwnerActions}
|
|
||||||
abandonActionCallback={abandonActionCallback}
|
|
||||||
showUnresolvedClaim={showUnresolvedClaims}
|
showUnresolvedClaim={showUnresolvedClaims}
|
||||||
properties={renderProperties || (type !== 'small' ? undefined : false)}
|
properties={renderProperties || (type !== 'small' ? undefined : false)}
|
||||||
showUserBlocked={showHiddenByUser}
|
showUserBlocked={showHiddenByUser}
|
||||||
|
|
|
@ -15,7 +15,6 @@ import SubscribeButton from 'component/subscribeButton';
|
||||||
import ChannelThumbnail from 'component/channelThumbnail';
|
import ChannelThumbnail from 'component/channelThumbnail';
|
||||||
import BlockButton from 'component/blockButton';
|
import BlockButton from 'component/blockButton';
|
||||||
import ClaimSupportButton from 'component/claimSupportButton';
|
import ClaimSupportButton from 'component/claimSupportButton';
|
||||||
import ClaimAbandonButton from 'component/claimAbandonButton';
|
|
||||||
import useGetThumbnail from 'effects/use-get-thumbnail';
|
import useGetThumbnail from 'effects/use-get-thumbnail';
|
||||||
import ClaimPreviewTitle from 'component/claimPreviewTitle';
|
import ClaimPreviewTitle from 'component/claimPreviewTitle';
|
||||||
import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle';
|
import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle';
|
||||||
|
@ -59,8 +58,6 @@ type Props = {
|
||||||
customShouldHide?: Claim => boolean,
|
customShouldHide?: Claim => boolean,
|
||||||
showUnresolvedClaim?: boolean,
|
showUnresolvedClaim?: boolean,
|
||||||
includeSupportAction?: boolean,
|
includeSupportAction?: boolean,
|
||||||
includeOwnerActions?: boolean,
|
|
||||||
abandonActionCallback?: any => void,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
|
@ -93,8 +90,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
customShouldHide,
|
customShouldHide,
|
||||||
showUnresolvedClaim,
|
showUnresolvedClaim,
|
||||||
includeSupportAction,
|
includeSupportAction,
|
||||||
includeOwnerActions,
|
|
||||||
abandonActionCallback,
|
|
||||||
} = props;
|
} = props;
|
||||||
const shouldFetch =
|
const shouldFetch =
|
||||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||||
|
@ -288,9 +283,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||||
<BlockButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
<BlockButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
||||||
)}
|
)}
|
||||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||||
{includeOwnerActions && (
|
|
||||||
<ClaimAbandonButton uri={uri} abandonActionCallback={abandonActionCallback} />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
|
|
@ -72,14 +72,7 @@ function FileListPublished(props: Props) {
|
||||||
isBodyList
|
isBodyList
|
||||||
body={
|
body={
|
||||||
<div>
|
<div>
|
||||||
<ClaimList
|
<ClaimList isCardBody loading={fetching} persistedStorageKey="claim-list-published" uris={urls} />
|
||||||
isCardBody
|
|
||||||
loading={fetching}
|
|
||||||
persistedStorageKey="claim-list-published"
|
|
||||||
uris={urls}
|
|
||||||
includeOwnerActions
|
|
||||||
abandonActionCallback={() => fetchClaimListMine(params.page, params.page_size)}
|
|
||||||
/>
|
|
||||||
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ function ShowPage(props: Props) {
|
||||||
const canonicalUrl = claim && claim.canonical_url;
|
const canonicalUrl = claim && claim.canonical_url;
|
||||||
const claimExists = claim !== null && claim !== undefined;
|
const claimExists = claim !== null && claim !== undefined;
|
||||||
const haventFetchedYet = claim === undefined;
|
const haventFetchedYet = claim === undefined;
|
||||||
|
const isMine = claim && claim.is_my_output;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
|
@ -42,10 +43,13 @@ function ShowPage(props: Props) {
|
||||||
}
|
}
|
||||||
// @endif
|
// @endif
|
||||||
|
|
||||||
if ((resolveUri && !isResolvingUri && uri && haventFetchedYet) || (claimExists && !canonicalUrl)) {
|
if (
|
||||||
|
(resolveUri && !isResolvingUri && uri && haventFetchedYet) ||
|
||||||
|
(claimExists && (!canonicalUrl || isMine === undefined))
|
||||||
|
) {
|
||||||
resolveUri(uri);
|
resolveUri(uri);
|
||||||
}
|
}
|
||||||
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history]);
|
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history, isMine]);
|
||||||
|
|
||||||
// Don't navigate directly to repost urls
|
// Don't navigate directly to repost urls
|
||||||
// Always redirect to the actual content
|
// Always redirect to the actual content
|
||||||
|
|
Loading…
Reference in a new issue