From 3d4e35e32f42b96542978c935a686e4d0f36cc1a Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Thu, 29 Aug 2019 19:18:06 -0400 Subject: [PATCH] fixes: canonical url + sub downloads Sub downloads is just missing the last step - need to check why it's not being resolved/saved. --- package.json | 2 +- src/ui/component/claimPreview/view.jsx | 2 +- src/ui/component/publishForm/view.jsx | 4 +-- .../component/publishName/name-help-text.jsx | 4 +-- src/ui/component/router/view.jsx | 2 +- src/ui/component/subscribeButton/view.jsx | 3 +- .../internal/transaction-list-item.jsx | 8 ++--- src/ui/page/channel/view.jsx | 2 +- src/ui/redux/actions/content.js | 14 ++++----- src/ui/redux/actions/subscriptions.js | 30 +++++++++---------- src/ui/redux/selectors/file_info.js | 8 +---- 11 files changed, 37 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index 9797679a1..be1669c5c 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "jsmediatags": "^3.8.1", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#a9e2cc91838af340d4566b384b20d7b0af8e68df", + "lbry-redux": "lbryio/lbry-redux#48dd46a9a837d81cff8700b7a571baa8081bf3aa", "lbryinc": "lbryio/lbryinc#1ce266b3c52654190b955e9c869b8e302aa5c585", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/src/ui/component/claimPreview/view.jsx b/src/ui/component/claimPreview/view.jsx index 44f7aa45a..70a189fb6 100644 --- a/src/ui/component/claimPreview/view.jsx +++ b/src/ui/component/claimPreview/view.jsx @@ -82,7 +82,7 @@ const ClaimPreview = forwardRef((props: Props, ref: any) => { let isValid = false; if (uri) { try { - ({ claimName: name } = parseURI(uri)); + ({ streamName: name } = parseURI(uri)); isValid = true; } catch (e) { isValid = false; diff --git a/src/ui/component/publishForm/view.jsx b/src/ui/component/publishForm/view.jsx index bae773b6f..c69054d56 100644 --- a/src/ui/component/publishForm/view.jsx +++ b/src/ui/component/publishForm/view.jsx @@ -102,13 +102,13 @@ function PublishForm(props: Props) { // We are only going to store the full uri, but we need to resolve the uri with and without the channel name let uri; try { - uri = buildURI({ contentName: name, channelName }); + uri = buildURI({ streamName: name, channelName }); } catch (e) {} if (channelName) { // resolve without the channel name so we know the winning bid for it try { - const uriLessChannel = buildURI({ contentName: name }); + const uriLessChannel = buildURI({ streamName: name }); resolveUri(uriLessChannel); } catch (e) {} } diff --git a/src/ui/component/publishName/name-help-text.jsx b/src/ui/component/publishName/name-help-text.jsx index bddf323fa..3aaa67e9b 100644 --- a/src/ui/component/publishName/name-help-text.jsx +++ b/src/ui/component/publishName/name-help-text.jsx @@ -19,8 +19,8 @@ function NameHelpText(props: Props) { nameHelpText = __('You are currently editing this claim. If you change the URL, you will need to reselect a file.'); } else if (uri && myClaimForUri) { const editUri = buildURI({ - contentName: myClaimForUri.name, - claimId: myClaimForUri.claim_id, + streamName: myClaimForUri.name, + streamClaimId: myClaimForUri.claim_id, }); nameHelpText = ( diff --git a/src/ui/component/router/view.jsx b/src/ui/component/router/view.jsx index 3a1ed042f..e16b960bb 100644 --- a/src/ui/component/router/view.jsx +++ b/src/ui/component/router/view.jsx @@ -68,7 +68,7 @@ function AppRouter(props: Props) { {/* Below need to go at the end to make sure we don't match any of our pages first */} - + {/* Route not found. Mostly for people typing crazy urls into the url */} } /> diff --git a/src/ui/component/subscribeButton/view.jsx b/src/ui/component/subscribeButton/view.jsx index e7e71e47a..6883d0ddd 100644 --- a/src/ui/component/subscribeButton/view.jsx +++ b/src/ui/component/subscribeButton/view.jsx @@ -35,7 +35,8 @@ export default function SubscribeButton(props: Props) { } = props; const buttonRef = useRef(); const isHovering = useHover(buttonRef); - const { claimName } = parseURI(uri); + const { channelName } = parseURI(uri); + const claimName = '@' + channelName; const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe; const subscriptionLabel = isSubscribed ? __('Following') : __('Follow'); const unfollowOverride = isSubscribed && isHovering && __('Unfollow'); diff --git a/src/ui/component/transactionList/internal/transaction-list-item.jsx b/src/ui/component/transactionList/internal/transaction-list-item.jsx index 4b5f36423..9b5efea97 100644 --- a/src/ui/component/transactionList/internal/transaction-list-item.jsx +++ b/src/ui/component/transactionList/internal/transaction-list-item.jsx @@ -45,10 +45,10 @@ class TransactionListItem extends React.PureComponent { // Ensure the claim name exists and is valid let uri; - let claimName = name; + let streamName = name; try { - ({ claimName } = parseURI(name)); - uri = buildURI({ claimName: claimName, claimId }); + ({ streamName } = parseURI(name)); + uri = buildURI({ streamName, streamClaimId: claimId }); } catch (e) {} const dateFormat = { @@ -74,7 +74,7 @@ class TransactionListItem extends React.PureComponent { {reward && {reward.reward_title}} - {name && claimId &&