Re-ran prettier

This commit is contained in:
liamcardenas 2018-03-07 11:19:45 -08:00
parent 6e293fd04b
commit 1e1c494367
3 changed files with 33 additions and 6 deletions

View file

@ -40,7 +40,13 @@ class FilePage extends React.PureComponent {
props.checkSubscriptionLatest( props.checkSubscriptionLatest(
{ {
channelName: props.claim.channel_name, channelName: props.claim.channel_name,
uri: buildURI({ contentName: props.claim.channel_name, claimId: props.claim.value.publisherSignature.certificateId }, false), uri: buildURI(
{
contentName: props.claim.channel_name,
claimId: props.claim.value.publisherSignature.certificateId,
},
false
),
}, },
buildURI({ contentName: props.claim.name, claimId: props.claim.claim_id }, false) buildURI({ contentName: props.claim.name, claimId: props.claim.claim_id }, false)
); );

View file

@ -365,7 +365,13 @@ export function doFetchClaimsByChannel(uri, page) {
setSubscriptionLatest( setSubscriptionLatest(
{ {
channelName: latest.channel_name, channelName: latest.channel_name,
uri: buildURI({ contentName: latest.channel_name, claimId: latest.value.publisherSignature.certificateId }, false), uri: buildURI(
{
contentName: latest.channel_name,
claimId: latest.value.publisherSignature.certificateId,
},
false
),
}, },
buildURI({ contentName: latest.name, claimId: latest.claim_id }, false) buildURI({ contentName: latest.name, claimId: latest.claim_id }, false)
) )

View file

@ -51,7 +51,10 @@ export const doCheckSubscription = (subscription: Subscription) => (dispatch: Di
let count = subscription.latest let count = subscription.latest
? claimsInChannel.reduce( ? claimsInChannel.reduce(
(prev, cur, index) => (prev, cur, index) =>
buildURI({ contentName: cur.name, claimId: cur.claim_id}, false) === subscription.latest ? index : prev, buildURI({ contentName: cur.name, claimId: cur.claim_id }, false) ===
subscription.latest
? index
: prev,
-1 -1
) )
: 1; : 1;
@ -59,7 +62,13 @@ export const doCheckSubscription = (subscription: Subscription) => (dispatch: Di
if (count !== 0) { if (count !== 0) {
if (!claimsInChannel[0].value.stream.metadata.fee) { if (!claimsInChannel[0].value.stream.metadata.fee) {
dispatch( dispatch(
doPurchaseUri(buildURI({ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id }, false), { cost: 0 }) doPurchaseUri(
buildURI(
{ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id },
false
),
{ cost: 0 }
)
); );
} }
@ -72,7 +81,10 @@ export const doCheckSubscription = (subscription: Subscription) => (dispatch: Di
notif.onclick = () => { notif.onclick = () => {
dispatch( dispatch(
doNavigate('/show', { doNavigate('/show', {
uri: buildURI({ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id }, true), uri: buildURI(
{ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id },
true
),
}) })
); );
}; };
@ -96,7 +108,10 @@ export const checkSubscriptionLatest = (channel: Subscription, uri: string) => (
if ( if (
claimsInChannel && claimsInChannel &&
claimsInChannel.length && claimsInChannel.length &&
buildURI({ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id }, false) === uri buildURI(
{ contentName: claimsInChannel[0].name, claimId: claimsInChannel[0].claim_id },
false
) === uri
) { ) {
dispatch(setSubscriptionLatest(channel, uri)); dispatch(setSubscriptionLatest(channel, uri));
} }