From f2c51f77358a3f09ac9a2d986eeba57b103f05a9 Mon Sep 17 00:00:00 2001 From: jessop Date: Tue, 2 Jul 2019 22:30:34 -0400 Subject: [PATCH 1/5] successfully publishes using lbry-redux updates lbry-redux hash adds streamPublish success and fail callbacks passing callbacks in doPublish( success, fail ) update redux prepare rebase --- .../publishAdditionalOptions/index.js | 9 +- src/ui/component/publishFile/index.js | 5 +- src/ui/component/publishForm/index.js | 10 +- src/ui/component/publishForm/view.jsx | 2 +- src/ui/component/publishFormErrors/index.js | 2 +- src/ui/component/publishName/index.js | 9 +- src/ui/component/publishPrice/index.js | 3 +- src/ui/component/publishText/index.js | 3 +- src/ui/component/selectThumbnail/index.js | 9 +- src/ui/index.jsx | 50 +++- .../modal/modalAutoGenerateThumbnail/index.js | 3 +- .../modalConfirmThumbnailUpload/index.js | 2 +- src/ui/modal/modalPublish/index.js | 2 +- src/ui/page/file/index.js | 2 +- src/ui/page/fileListPublished/index.js | 3 +- src/ui/reducers.js | 3 +- src/ui/redux/actions/publish.js | 64 +++++- src/ui/redux/reducers/publish.js | 214 +++++++++--------- 18 files changed, 243 insertions(+), 152 deletions(-) diff --git a/src/ui/component/publishAdditionalOptions/index.js b/src/ui/component/publishAdditionalOptions/index.js index 0d1481e57..463b8cb05 100644 --- a/src/ui/component/publishAdditionalOptions/index.js +++ b/src/ui/component/publishAdditionalOptions/index.js @@ -1,19 +1,18 @@ import { connect } from 'react-redux'; -import { doResolveUri, selectBalance } from 'lbry-redux'; import { + doResolveUri, + selectBalance, selectPublishFormValues, selectIsStillEditing, selectMyClaimForUri, selectIsResolvingPublishUris, selectTakeOverAmount, -} from 'redux/selectors/publish'; -import { doResetThumbnailStatus, doClearPublish, doUpdatePublishForm, - doPublish, doPrepareEdit, -} from 'redux/actions/publish'; +} from 'lbry-redux'; +import { doPublish } from 'redux/actions/publish'; import { selectUnclaimedRewardValue } from 'lbryinc'; import PublishPage from './view'; diff --git a/src/ui/component/publishFile/index.js b/src/ui/component/publishFile/index.js index 5d909d94d..21525c70c 100644 --- a/src/ui/component/publishFile/index.js +++ b/src/ui/component/publishFile/index.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; -import { selectBalance } from 'lbry-redux'; -import { selectIsStillEditing, makeSelectPublishFormValue } from 'redux/selectors/publish'; -import { doUpdatePublishForm } from 'redux/actions/publish'; + +import { selectBalance, selectIsStillEditing, makeSelectPublishFormValue, doUpdatePublishForm } from 'lbry-redux'; import PublishPage from './view'; const select = state => ({ diff --git a/src/ui/component/publishForm/index.js b/src/ui/component/publishForm/index.js index 929e444ed..7c27d24ec 100644 --- a/src/ui/component/publishForm/index.js +++ b/src/ui/component/publishForm/index.js @@ -1,19 +1,17 @@ import { connect } from 'react-redux'; -import { doResolveUri } from 'lbry-redux'; import { + doResolveUri, selectPublishFormValues, selectIsStillEditing, selectMyClaimForUri, selectIsResolvingPublishUris, selectTakeOverAmount, -} from 'redux/selectors/publish'; -import { doResetThumbnailStatus, doClearPublish, doUpdatePublishForm, - doPublish, doPrepareEdit, -} from 'redux/actions/publish'; +} from 'lbry-redux'; +import { doPublish } from 'redux/actions/publish'; import { selectUnclaimedRewardValue } from 'lbryinc'; import PublishPage from './view'; @@ -34,7 +32,7 @@ const perform = dispatch => ({ updatePublishForm: value => dispatch(doUpdatePublishForm(value)), clearPublish: () => dispatch(doClearPublish()), resolveUri: uri => dispatch(doResolveUri(uri)), - publish: params => dispatch(doPublish(params)), + publish: (success, fail) => dispatch(doPublish(success, fail)), prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)), resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()), }); diff --git a/src/ui/component/publishForm/view.jsx b/src/ui/component/publishForm/view.jsx index bae773b6f..b4c1167a0 100644 --- a/src/ui/component/publishForm/view.jsx +++ b/src/ui/component/publishForm/view.jsx @@ -170,7 +170,7 @@ function PublishForm(props: Props) {