do not show warning on own claims and lbry related links
This commit is contained in:
parent
e43ad2ce89
commit
ca1c95b093
3 changed files with 21 additions and 3 deletions
|
@ -5,6 +5,7 @@ import * as React from 'react';
|
|||
import { isURIValid } from 'lbry-redux';
|
||||
import Button from 'component/button';
|
||||
import ClaimLink from 'component/claimLink';
|
||||
import { isLBRYDomain } from 'util/uri';
|
||||
|
||||
type Props = {
|
||||
href: string,
|
||||
|
@ -37,7 +38,10 @@ class ExternalLink extends React.PureComponent<Props> {
|
|||
title={title || href}
|
||||
label={children}
|
||||
className="button--external-link"
|
||||
onClick={() => openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { uri: href })}
|
||||
onClick={() => {
|
||||
const isTrusted = isLBRYDomain(href);
|
||||
openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { uri: href, isTrusted: isTrusted });
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
makeSelectDownloadingForUri,
|
||||
makeSelectLoadingForUri,
|
||||
makeSelectClaimForUri,
|
||||
makeSelectClaimIsMine,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectCostInfoForUri } from 'lbryinc';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
|
@ -17,6 +18,7 @@ const select = (state, props) => ({
|
|||
costInfo: makeSelectCostInfoForUri(props.uri)(state),
|
||||
loading: makeSelectLoadingForUri(props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
|
|
@ -8,6 +8,7 @@ import analytics from 'analytics';
|
|||
|
||||
type Props = {
|
||||
claim: StreamClaim,
|
||||
claimIsMine: boolean,
|
||||
uri: string,
|
||||
downloading: boolean,
|
||||
fileInfo: ?{
|
||||
|
@ -44,7 +45,18 @@ class FileDownloadLink extends React.PureComponent<Props> {
|
|||
uri: ?string;
|
||||
|
||||
render() {
|
||||
const { fileInfo, downloading, uri, openModal, purchaseUri, costInfo, loading, pause, claim } = this.props;
|
||||
const {
|
||||
fileInfo,
|
||||
downloading,
|
||||
uri,
|
||||
openModal,
|
||||
purchaseUri,
|
||||
costInfo,
|
||||
loading,
|
||||
pause,
|
||||
claim,
|
||||
claimIsMine,
|
||||
} = this.props;
|
||||
|
||||
if (loading || downloading) {
|
||||
const progress = fileInfo && fileInfo.written_bytes ? (fileInfo.written_bytes / fileInfo.total_bytes) * 100 : 0;
|
||||
|
@ -81,7 +93,7 @@ class FileDownloadLink extends React.PureComponent<Props> {
|
|||
icon={ICONS.EXTERNAL}
|
||||
onClick={() => {
|
||||
pause();
|
||||
openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { path: fileInfo.download_path });
|
||||
openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { path: fileInfo.download_path, isMine: claimIsMine });
|
||||
}}
|
||||
/>
|
||||
</ToolTip>
|
||||
|
|
Loading…
Reference in a new issue