remove LBRY_INC_DOMAINS list

This commit is contained in:
Sean Yesmunt 2019-12-03 12:32:38 -05:00
parent bf512e8338
commit 6a69ffe0fb
2 changed files with 1 additions and 22 deletions

View file

@ -5,7 +5,6 @@ import * as React from 'react';
import { isURIValid } from 'lbry-redux'; import { isURIValid } from 'lbry-redux';
import Button from 'component/button'; import Button from 'component/button';
import ClaimLink from 'component/claimLink'; import ClaimLink from 'component/claimLink';
import { isLBRYDomain } from 'util/url';
type Props = { type Props = {
href: string, href: string,
@ -39,8 +38,7 @@ class ExternalLink extends React.PureComponent<Props> {
label={children} label={children}
className="button--external-link" className="button--external-link"
onClick={() => { onClick={() => {
const isTrusted = isLBRYDomain(href); openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { uri: href, isTrusted: false });
openModal(MODALS.CONFIRM_EXTERNAL_RESOURCE, { uri: href, isTrusted: isTrusted });
}} }}
/> />
); );

View file

@ -1,5 +1,3 @@
const LBRY_INC_DOMAINS = ['lbry.io', 'lbry.com', 'lbry.tv', 'lbry.tech', 'lbry.fund', 'spee.ch'];
exports.formatLbryUrlForWeb = uri => { exports.formatLbryUrlForWeb = uri => {
return uri.replace('lbry://', '/').replace(/#/g, ':'); return uri.replace('lbry://', '/').replace(/#/g, ':');
}; };
@ -18,23 +16,6 @@ exports.formatFileSystemPath = path => {
return encodeURI(`file://${webUrl}`).replace(/[?#]/g, encodeURIComponent); return encodeURI(`file://${webUrl}`).replace(/[?#]/g, encodeURIComponent);
}; };
exports.isLBRYDomain = uri => {
if (!uri) {
return;
}
const myURL = new URL(uri);
const hostname = myURL.hostname;
for (let domain of LBRY_INC_DOMAINS) {
if (hostname.endsWith(domain)) {
return true;
}
}
return false;
};
/* /*
Function that handles page redirects Function that handles page redirects
ex: lbry://?rewards ex: lbry://?rewards