diff --git a/ui/page/file/view.jsx b/ui/page/file/view.jsx index 075cd569f..df445f3fa 100644 --- a/ui/page/file/view.jsx +++ b/ui/page/file/view.jsx @@ -61,7 +61,7 @@ class FilePage extends React.Component { } // @if TARGET='app' - if (fileInfo === undefined) { + if (prevProps.uri !== uri && fileInfo === undefined) { fetchFileInfo(uri); } // @endif @@ -77,6 +77,7 @@ class FilePage extends React.Component { render() { const { uri, claimIsMine, costInfo, fileInfo, balance, isText } = this.props; const insufficientCredits = !claimIsMine && costInfo && costInfo.cost > balance; + return ( {!fileInfo && insufficientCredits && ( diff --git a/ui/page/show/view.jsx b/ui/page/show/view.jsx index 21b8086fb..151a5999c 100644 --- a/ui/page/show/view.jsx +++ b/ui/page/show/view.jsx @@ -1,5 +1,6 @@ // @flow import React, { useEffect } from 'react'; +import { Redirect } from 'react-router-dom'; import { parseURI } from 'lbry-redux'; import BusyIndicator from 'component/common/busy-indicator'; import ChannelPage from 'page/channel'; @@ -9,6 +10,7 @@ import Button from 'component/button'; import { SITE_TITLE } from 'config'; import Card from 'component/common/card'; import AbandonedChannelPreview from 'component/abandonedChannelPreview'; +import { formatLbryUrlForWeb } from 'util/url'; type Props = { isResolvingUri: boolean, @@ -74,14 +76,17 @@ function ShowPage(props: Props) { }; }, [title, channelName, streamName]); - let innerContent = ''; + // Don't navigate directly to repost urls + // Always redirect to the actual content + // Also need to add repost_url to the Claim type for flow + // $FlowFixMe + if (claim && claim.repost_url === uri) { + const newUrl = formatLbryUrlForWeb(claim.canonical_url); + return ; + } + let innerContent = ''; if (!claim || (claim && !claim.name)) { - if (claim && !claim.name) { - // While testing the normalization changes, Brannon found that `name` was missing sometimes - // This shouldn't happen, so hopefully this helps track it down - console.error('No name for associated claim: ', claim.claim_id); // eslint-disable-line no-console - } innerContent = ( {(claim === undefined || isResolvingUri) && } diff --git a/webpack.base.config.js b/webpack.base.config.js index 02101840c..a99ec0063 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -12,7 +12,7 @@ const STATIC_ROOT = path.resolve(__dirname, 'static/'); let baseConfig = { mode: ifProduction('production', 'development'), - devtool: ifProduction('source-map', 'eval-cheap-source-map'), + devtool: ifProduction('source-map', 'eval-cheap-module-source-map'), optimization: { minimizer: [ new TerserPlugin({