From 26f460d2ae6cc7e5b620f5065b9aa7fd99c5dbb3 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 28 Jul 2020 15:14:27 -0400 Subject: [PATCH] Revert "update arguments order" This reverts commit de15a56ed8f78dafd02fa77383beeb3bc18fa4de. --- web/src/html.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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);