fixes #3348 by clearing publish fields when user clicks the 'new publish' button
This commit is contained in:
parent
b678771c8a
commit
189bef4287
2 changed files with 11 additions and 8 deletions
|
@ -3,6 +3,7 @@ import {
|
||||||
selectIsFetchingClaimListMine,
|
selectIsFetchingClaimListMine,
|
||||||
makeSelectMyStreamUrlsForPage,
|
makeSelectMyStreamUrlsForPage,
|
||||||
selectMyStreamUrlsCount,
|
selectMyStreamUrlsCount,
|
||||||
|
doClearPublish,
|
||||||
doFetchClaimListMine,
|
doFetchClaimListMine,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import { doCheckPendingPublishesApp } from 'redux/actions/publish';
|
import { doCheckPendingPublishesApp } from 'redux/actions/publish';
|
||||||
|
@ -24,11 +25,7 @@ const select = (state, props) => {
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
checkPendingPublishes: () => dispatch(doCheckPendingPublishesApp()),
|
checkPendingPublishes: () => dispatch(doCheckPendingPublishesApp()),
|
||||||
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
|
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
|
||||||
|
clearPublish: () => dispatch(doClearPublish()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default withRouter(
|
export default withRouter(connect(select, perform)(FileListPublished));
|
||||||
connect(
|
|
||||||
select,
|
|
||||||
perform
|
|
||||||
)(FileListPublished)
|
|
||||||
);
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import Spinner from 'component/spinner';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
checkPendingPublishes: () => void,
|
checkPendingPublishes: () => void,
|
||||||
|
clearPublish: () => void,
|
||||||
fetchClaimListMine: () => void,
|
fetchClaimListMine: () => void,
|
||||||
fetching: boolean,
|
fetching: boolean,
|
||||||
urls: Array<string>,
|
urls: Array<string>,
|
||||||
|
@ -19,7 +20,7 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function FileListPublished(props: Props) {
|
function FileListPublished(props: Props) {
|
||||||
const { checkPendingPublishes, fetchClaimListMine, fetching, urls, urlTotal } = props;
|
const { checkPendingPublishes, clearPublish, fetchClaimListMine, fetching, urls, urlTotal } = props;
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
checkPendingPublishes();
|
checkPendingPublishes();
|
||||||
fetchClaimListMine();
|
fetchClaimListMine();
|
||||||
|
@ -47,7 +48,12 @@ function FileListPublished(props: Props) {
|
||||||
<div className=" section--small">
|
<div className=" section--small">
|
||||||
<h2 className="section__title--large">{__('Nothing published to LBRY yet.')}</h2>
|
<h2 className="section__title--large">{__('Nothing published to LBRY yet.')}</h2>
|
||||||
<div className="section__actions">
|
<div className="section__actions">
|
||||||
<Button button="primary" navigate="/$/publish" label={__('Publish something new')} />
|
<Button
|
||||||
|
button="primary"
|
||||||
|
navigate="/$/publish"
|
||||||
|
label={__('Publish something new')}
|
||||||
|
onClick={() => clearPublish()}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
Loading…
Reference in a new issue