From 278b817d8dc2901d0a23775ff4d8402020161d4e Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 21 Mar 2019 12:44:07 -0400 Subject: [PATCH] fix: twitter share links --- src/ui/component/socialShare/view.jsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/ui/component/socialShare/view.jsx b/src/ui/component/socialShare/view.jsx index b3daa04a0..0cf996c3e 100644 --- a/src/ui/component/socialShare/view.jsx +++ b/src/ui/component/socialShare/view.jsx @@ -40,19 +40,27 @@ class SocialShare extends React.PureComponent { let lbryURL; if (isChannel) { // For channel claims, the channel name (@something) is in `claim.name` - speechURL = `${speechPrefix}${claimName}:${claimId}`; - lbryURL = `${lbryPrefix}${claimName}#${claimId}`; + speechURL = `${claimName}:${claimId}`; + lbryURL = `${claimName}#${claimId}`; } else { // If it's for a regular claim, check if it has an associated channel speechURL = channelName && channelClaimId - ? `${speechPrefix}${channelName}:${channelClaimId}/${claimName}` - : `${speechPrefix}${claimId}/${claimName}`; + ? `${channelName}:${channelClaimId}/${claimName}` + : `${claimId}/${claimName}`; lbryURL = channelName && channelClaimId - ? `${lbryPrefix}${channelName}#${channelClaimId}/${claimName}` - : `${lbryPrefix}${claimName}#${claimId}`; + ? `${channelName}#${channelClaimId}/${claimName}` + : `${claimName}#${claimId}`; + } + + if (lbryURL) { + lbryURL = `${lbryPrefix}${encodeURIComponent(lbryURL)}`; + } + + if (speechURL) { + speechURL = `${speechPrefix}${encodeURIComponent(speechURL)}`; } return (