diff --git a/web/src/html.js b/web/src/html.js index 7796de7c1..c52cfe96b 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -138,7 +138,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}) { return head; } -async function getClaimFromChainqueryOrRedirect(ctx, url) { +async function getClaimFromChainqueryOrRedirect(url, ctx) { const { isChannel, streamName, channelName, channelClaimId, streamClaimId } = parseURI(url); const claimName = isChannel ? '@' + channelName : streamName; const claimId = isChannel ? channelClaimId : streamClaimId; @@ -179,7 +179,7 @@ async function getHtml(ctx) { try { parseURI(inviteChannelUrl); - const claim = await getClaimFromChainqueryOrRedirect(ctx, inviteChannelUrl); + const claim = await getClaimFromChainqueryOrRedirect(inviteChannelUrl, ctx); const invitePageMetadata = buildClaimOgMetadata(inviteChannelUrl, claim, { title: `Join ${claim.name} on LBRY`, description: `Join ${claim.name} on LBRY, a content wonderland owned by everyone (and no one).`, @@ -199,7 +199,7 @@ async function getHtml(ctx) { if (requestPath.includes(embedPath)) { const claimUri = requestPath.replace(embedPath, '').replace(/:/g, '#'); - const claim = await getClaimFromChainqueryOrRedirect(ctx, claimUri); + const claim = await getClaimFromChainqueryOrRedirect(claimUri, ctx); if (claim) { const ogMetadata = buildClaimOgMetadata(claimUri, claim); @@ -211,8 +211,8 @@ async function getHtml(ctx) { if (!requestPath.includes('$')) { const claimUri = requestPath.slice(1).replace(/:/g, '#'); - const claim = await getClaimFromChainqueryOrRedirect(ctx, claimUri); - + const claim = await getClaimFromChainqueryOrRedirect(claimUri, ctx); + console.log('claim', claim); if (claim) { const ogMetadata = buildClaimOgMetadata(claimUri, claim); return insertToHead(html, ogMetadata);