Revert "update arguments order"

This reverts commit de15a56ed8.
This commit is contained in:
Sean Yesmunt 2020-07-28 15:14:27 -04:00
parent de15a56ed8
commit 26f460d2ae

View file

@ -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);