fix subscribe uri on channel pages

This commit is contained in:
Sean Yesmunt 2018-10-31 13:08:30 -04:00
parent 32d110cb1f
commit 639f99555f
2 changed files with 8 additions and 1 deletions

View file

@ -87,7 +87,7 @@ class ChannelPage extends React.PureComponent<Props> {
</h1>
</section>
<div className="card__actions">
<SubscribeButton uri={permanentUrl} channelName={name} />
<SubscribeButton uri={`lbry://${permanentUrl}`} channelName={name} />
<ViewOnWebButton claimId={claimId} claimName={name} />
</div>
<section className="card__content">{contentList}</section>

View file

@ -315,6 +315,13 @@ export const doChannelSubscribe = (subscription: Subscription) => (
} = getState();
const { share_usage_data: isSharingData } = daemonSettings;
const subscriptionUri = subscription.uri;
if (!subscriptionUri.startsWith('lbry://')) {
throw Error(
`Subscription uris must inclue the "lbry://" prefix.\nTried to subscribe to ${subscriptionUri}`
);
}
dispatch({
type: ACTIONS.CHANNEL_SUBSCRIBE,
data: subscription,