fix: don't re-resolve on file page if we don't need to

This commit is contained in:
Sean Yesmunt 2019-11-18 14:19:59 -05:00
parent d38b3de5c6
commit f7c00dd070
3 changed files with 6 additions and 6 deletions

View file

@ -124,7 +124,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#84fb36841a030447e08ef2d583684cd0a573b4b2",
"lbry-redux": "lbryio/lbry-redux#f5a62363cf6d3ff33a42a4446e6df3024a7780d8",
"lbryinc": "lbryio/lbryinc#2aedf5a188f028f61c45bc7ed0c747a2d4ae453a",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -27,7 +27,7 @@ function ShowPage(props: Props) {
const { channelName, channelClaimId, streamName, streamClaimId } = parseURI(uri);
const signingChannel = claim && claim.signing_channel;
const canonicalUrl = claim && claim.canonical_url;
const hasClaim = !!claim;
const noClaim = claim === undefined;
useEffect(() => {
// @if TARGET='web'
@ -39,10 +39,10 @@ function ShowPage(props: Props) {
}
// @endif
if (resolveUri && !isResolvingUri && uri && (claim === undefined || (hasClaim && !canonicalUrl))) {
if (resolveUri && !isResolvingUri && uri && (noClaim || !canonicalUrl)) {
resolveUri(uri);
}
}, [resolveUri, isResolvingUri, canonicalUrl, uri, hasClaim]);
}, [resolveUri, isResolvingUri, canonicalUrl, uri, noClaim]);
useEffect(() => {
if (title) {

View file

@ -7032,9 +7032,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#84fb36841a030447e08ef2d583684cd0a573b4b2:
lbry-redux@lbryio/lbry-redux#f5a62363cf6d3ff33a42a4446e6df3024a7780d8:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/84fb36841a030447e08ef2d583684cd0a573b4b2"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/f5a62363cf6d3ff33a42a4446e6df3024a7780d8"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"