dont re-resolve on empty claims

This commit is contained in:
Sean Yesmunt 2019-11-19 12:41:31 -05:00
parent 56eeca76a5
commit e51f31f015
2 changed files with 5 additions and 4 deletions

View file

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

View file

@ -155,7 +155,7 @@ fieldset-group {
fieldset-section {
width: auto;
margin-bottom: 0;
margin: 0;
&:first-child {
input,