This commit is contained in:
Sean Yesmunt 2019-11-15 10:13:19 -05:00
parent 18cc6a7c48
commit fc0a0ed6bc
2 changed files with 7 additions and 5 deletions

View file

@ -42,7 +42,7 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
})} })}
</p> </p>
<div className="card--inline"> <div className="card--inline">
<ClaimPreview uri={uri} /> <ClaimPreview type="small" uri={uri} />
</div> </div>
<p className="help"> <p className="help">
{filePath && !IS_WEB && ( {filePath && !IS_WEB && (

View file

@ -26,20 +26,22 @@ function ShowPage(props: Props) {
const { isResolvingUri, resolveUri, uri, claim, blackListedOutpoints, location, title } = props; const { isResolvingUri, resolveUri, uri, claim, blackListedOutpoints, location, title } = props;
const { channelName, channelClaimId, streamName, streamClaimId } = parseURI(uri); const { channelName, channelClaimId, streamName, streamClaimId } = parseURI(uri);
const signingChannel = claim && claim.signing_channel; const signingChannel = claim && claim.signing_channel;
const canonicalUrl = claim && claim.canonical_url;
useEffect(() => { useEffect(() => {
// @if TARGET='web' // @if TARGET='web'
if (claim && claim.canonical_url) { if (canonicalUrl) {
const canonicalUrlPath = '/' + claim.canonical_url.replace(/^lbry:\/\//, '').replace(/#/g, ':'); const canonicalUrlPath = '/' + canonicalUrl.replace(/^lbry:\/\//, '').replace(/#/g, ':');
if (canonicalUrlPath !== window.location.pathname) { if (canonicalUrlPath !== window.location.pathname) {
history.replaceState(history.state, '', canonicalUrlPath); history.replaceState(history.state, '', canonicalUrlPath);
} }
} }
// @endif // @endif
if (resolveUri && !isResolvingUri && uri && claim === undefined) {
if (resolveUri && !isResolvingUri && uri && (claim === undefined || !canonicalUrl)) {
resolveUri(uri); resolveUri(uri);
} }
}, [resolveUri, isResolvingUri, claim, uri]); }, [resolveUri, isResolvingUri, canonicalUrl, uri]);
useEffect(() => { useEffect(() => {
if (title) { if (title) {