diff --git a/src/ui/modal/modalPublish/index.js b/src/ui/modal/modalPublish/index.js index ccb125053..f6c26449d 100644 --- a/src/ui/modal/modalPublish/index.js +++ b/src/ui/modal/modalPublish/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { doHideModal } from 'redux/actions/app'; -import ModalSendTip from './view'; +import ModalPublishSuccess from './view'; import { doClearPublish } from 'redux/actions/publish'; import { push } from 'connected-react-router'; @@ -13,4 +13,4 @@ const perform = dispatch => ({ export default connect( null, perform -)(ModalSendTip); +)(ModalPublishSuccess); diff --git a/src/ui/modal/modalPublish/view.jsx b/src/ui/modal/modalPublish/view.jsx index bafaf319a..271a3fbce 100644 --- a/src/ui/modal/modalPublish/view.jsx +++ b/src/ui/modal/modalPublish/view.jsx @@ -7,17 +7,21 @@ type Props = { clearPublish: () => void, navigate: string => void, uri: string, + isEdit: boolean, }; class ModalPublishSuccess extends React.PureComponent { render() { - const { closeModal, clearPublish, navigate, uri } = this.props; + const { closeModal, clearPublish, navigate, uri, isEdit } = this.props; + const contentLabel = isEdit ? 'Updates published' : 'File published'; + const publishMessage = isEdit ? 'updates have been' : 'file has been'; + const publishType = isEdit ? 'updates' : 'file'; return ( { clearPublish(); navigate('/$/published'); @@ -25,11 +29,11 @@ class ModalPublishSuccess extends React.PureComponent { }} >
-

{__('Your file has been published to LBRY at the address')}

+

{__(`Your ${publishMessage} published to LBRY at the address`)}

{uri}

{__( - 'The file will take a few minutes to appear for other LBRY users. Until then it will be listed as "pending" under your published files.' + `The ${publishType} will take a few minutes to appear for other LBRY users. Until then it will be listed as "pending" under your published files.` )}

diff --git a/src/ui/redux/actions/publish.js b/src/ui/redux/actions/publish.js index b525c9632..5f9f8c132 100644 --- a/src/ui/redux/actions/publish.js +++ b/src/ui/redux/actions/publish.js @@ -303,17 +303,18 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat type: ACTIONS.PUBLISH_SUCCESS, }); - actions.push(doOpenModal(MODALS.PUBLISH, { uri })); - // We have to fake a temp claim until the new pending one is returned by claim_list_mine // We can't rely on claim_list_mine because there might be some delay before the new claims are returned // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one const isMatch = claim => claim.claim_id === pendingClaim.claim_id; const isEdit = myClaims.some(isMatch); + const myNewClaims = isEdit ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim)) : myClaims.concat(pendingClaim); + actions.push(doOpenModal(MODALS.PUBLISH, { uri, isEdit })); + actions.push({ type: ACTIONS.FETCH_CLAIM_LIST_MINE_COMPLETED, data: { diff --git a/static/locales/en.json b/static/locales/en.json index 770d0e5b5..bceb5f02d 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -284,5 +284,8 @@ "Connecting...": "Connecting...", "Downloading stream... not long left now!": "Downloading stream... not long left now!", "Downloading: ": "Downloading: ", - "% complete": "% complete" -} \ No newline at end of file + "% complete": "% complete", + "Updates published": "Updates published", + "Your updates have been published to LBRY at the address": "Your updates have been published to LBRY at the address", + "The updates will take a few minutes to appear for other LBRY users. Until then your file will be listed as \"pending\" under your published files.": "The updates will take a few minutes to appear for other LBRY users. Until then your file will be listed as \"pending\" under your published files." +}