diff --git a/package.json b/package.json index 83a61629b..58674a944 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "imagesloaded": "^4.1.4", "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", - "lbry-redux": "lbryio/lbry-redux#c0bfa4d32005266d41df18a19c93914c426a8067", + "lbry-redux": "lbryio/lbry-redux#906199d866a187015668a27363f010828c15979a", "lbryinc": "lbryio/lbryinc#72eee35f5181940eb4a468a27ddb2a2a4e362fb0", "lint-staged": "^7.0.2", "localforage": "^1.7.1", diff --git a/static/app-strings.json b/static/app-strings.json index 8260635df..beb5c24d6 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1278,5 +1278,14 @@ "Increasing your deposit can help your channel be discovered more easily.": "Increasing your deposit can help your channel be discovered more easily.", "Editing @%channel%": "Editing @%channel%", "This field cannot be changed.": "This field cannot be changed.", - "Delete Channel": "Delete Channel" -} \ No newline at end of file + "Delete Channel": "Delete Channel", + "Edit Thumbnail Image": "Edit Thumbnail Image", + "(Y x Z)": "(Y x Z)", + "Choose Image": "Choose Image", + "File to upload": "File to upload", + "Use a URL instead": "Use a URL instead", + "Edit Cover Image": "Edit Cover Image", + "Cover Image": "Cover Image", + "You Followed Your First Channel!": "You Followed Your First Channel!", + "Awesome! You just followed your first first channel.": "Awesome! You just followed your first first channel." +} diff --git a/ui/component/channelEdit/index.js b/ui/component/channelEdit/index.js index d1b32d3fa..818db49c9 100644 --- a/ui/component/channelEdit/index.js +++ b/ui/component/channelEdit/index.js @@ -13,6 +13,7 @@ import { selectCreateChannelError, selectCreatingChannel, selectBalance, + doClearChannelErrors, } from 'lbry-redux'; import { doOpenModal } from 'redux/actions/app'; @@ -44,6 +45,7 @@ const perform = dispatch => ({ const { name, amount, ...optionalParams } = params; return dispatch(doCreateChannel('@' + name, amount, optionalParams)); }, + clearChannelErrors: () => dispatch(doClearChannelErrors()), }); export default connect(select, perform)(ChannelPage); diff --git a/ui/component/channelEdit/view.jsx b/ui/component/channelEdit/view.jsx index 68b33908c..e37365b39 100644 --- a/ui/component/channelEdit/view.jsx +++ b/ui/component/channelEdit/view.jsx @@ -15,6 +15,7 @@ import { MINIMUM_PUBLISH_BID, INVALID_NAME_ERROR, ESTIMATED_FEE } from 'constant import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'component/common/tabs'; import Card from 'component/common/card'; import * as PAGES from 'constants/pages'; +import analytics from 'analytics'; const MAX_TAG_SELECT = 5; type Props = { @@ -37,6 +38,7 @@ type Props = { createChannel: any => Promise, createError: string, creatingChannel: boolean, + clearChannelErrors: () => void, onDone: () => void, openModal: ( id: string, @@ -65,6 +67,7 @@ function ChannelForm(props: Props) { createChannel, creatingChannel, createError, + clearChannelErrors, openModal, } = props; const [nameError, setNameError] = React.useState(undefined); @@ -121,10 +124,10 @@ function ChannelForm(props: Props) { if (bid <= 0.0 || isNaN(bid)) { setBidError(__('Deposit cannot be 0')); - } else if (totalAvailableBidAmount - bid < ESTIMATED_FEE) { - setBidError(__('Please decrease your deposit to account for transaction fees')); } else if (totalAvailableBidAmount < bid) { setBidError(__('Deposit cannot be higher than your balance')); + } else if (totalAvailableBidAmount - bid < ESTIMATED_FEE) { + setBidError(__('Please decrease your deposit to account for transaction fees')); } else if (bid < MINIMUM_PUBLISH_BID) { setBidError(__('Your deposit must be higher')); } else { @@ -150,6 +153,7 @@ function ChannelForm(props: Props) { } else { createChannel(params).then(success => { if (success) { + analytics.apiLogPublish(success); onDone(); } }); @@ -167,6 +171,10 @@ function ChannelForm(props: Props) { setNameError(nameError); }, [name]); + React.useEffect(() => { + clearChannelErrors(); + }, [clearChannelErrors]); + // TODO clear and bail after submit return ( <> @@ -357,7 +365,9 @@ function ChannelForm(props: Props) {