removes delete button and ensures resolve on show page

This commit is contained in:
jessop 2020-05-01 17:08:57 -04:00
parent 160015391e
commit 402710ce3b
4 changed files with 7 additions and 24 deletions

View file

@ -30,8 +30,6 @@ type Props = {
showUnresolvedClaims?: boolean,
renderProperties: ?(Claim) => Node,
includeSupportAction?: boolean,
includeOwnerActions?: boolean,
abandonActionCallback?: any => void,
hideBlock: boolean,
injectedItem: ?Node,
timedOutMessage?: Node,
@ -57,8 +55,6 @@ export default function ClaimList(props: Props) {
showUnresolvedClaims,
renderProperties,
includeSupportAction,
includeOwnerActions,
abandonActionCallback,
hideBlock,
injectedItem,
timedOutMessage,
@ -152,8 +148,6 @@ export default function ClaimList(props: Props) {
uri={uri}
type={type}
includeSupportAction={includeSupportAction}
includeOwnerActions={includeOwnerActions}
abandonActionCallback={abandonActionCallback}
showUnresolvedClaim={showUnresolvedClaims}
properties={renderProperties || (type !== 'small' ? undefined : false)}
showUserBlocked={showHiddenByUser}

View file

@ -15,7 +15,6 @@ import SubscribeButton from 'component/subscribeButton';
import ChannelThumbnail from 'component/channelThumbnail';
import BlockButton from 'component/blockButton';
import ClaimSupportButton from 'component/claimSupportButton';
import ClaimAbandonButton from 'component/claimAbandonButton';
import useGetThumbnail from 'effects/use-get-thumbnail';
import ClaimPreviewTitle from 'component/claimPreviewTitle';
import ClaimPreviewSubtitle from 'component/claimPreviewSubtitle';
@ -59,8 +58,6 @@ type Props = {
customShouldHide?: Claim => boolean,
showUnresolvedClaim?: boolean,
includeSupportAction?: boolean,
includeOwnerActions?: boolean,
abandonActionCallback?: any => void,
};
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
@ -93,8 +90,6 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
customShouldHide,
showUnresolvedClaim,
includeSupportAction,
includeOwnerActions,
abandonActionCallback,
} = props;
const shouldFetch =
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}`} />
)}
{includeSupportAction && <ClaimSupportButton uri={uri} />}
{includeOwnerActions && (
<ClaimAbandonButton uri={uri} abandonActionCallback={abandonActionCallback} />
)}
</div>
)}
</React.Fragment>

View file

@ -72,14 +72,7 @@ function FileListPublished(props: Props) {
isBodyList
body={
<div>
<ClaimList
isCardBody
loading={fetching}
persistedStorageKey="claim-list-published"
uris={urls}
includeOwnerActions
abandonActionCallback={() => fetchClaimListMine(params.page, params.page_size)}
/>
<ClaimList isCardBody loading={fetching} persistedStorageKey="claim-list-published" uris={urls} />
<Paginate totalPages={urlTotal > 0 ? Math.ceil(urlTotal / Number(pageSize)) : 1} />
</div>
}

View file

@ -31,6 +31,7 @@ function ShowPage(props: Props) {
const canonicalUrl = claim && claim.canonical_url;
const claimExists = claim !== null && claim !== undefined;
const haventFetchedYet = claim === undefined;
const isMine = claim && claim.is_my_output;
useEffect(() => {
// @if TARGET='web'
@ -42,10 +43,13 @@ function ShowPage(props: Props) {
}
// @endif
if ((resolveUri && !isResolvingUri && uri && haventFetchedYet) || (claimExists && !canonicalUrl)) {
if (
(resolveUri && !isResolvingUri && uri && haventFetchedYet) ||
(claimExists && (!canonicalUrl || isMine === undefined))
) {
resolveUri(uri);
}
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history]);
}, [resolveUri, isResolvingUri, canonicalUrl, uri, claimExists, haventFetchedYet, history, isMine]);
// Don't navigate directly to repost urls
// Always redirect to the actual content