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,
|
||||
makeSelectMyStreamUrlsForPage,
|
||||
selectMyStreamUrlsCount,
|
||||
doClearPublish,
|
||||
doFetchClaimListMine,
|
||||
} from 'lbry-redux';
|
||||
import { doCheckPendingPublishesApp } from 'redux/actions/publish';
|
||||
|
@ -24,11 +25,7 @@ const select = (state, props) => {
|
|||
const perform = dispatch => ({
|
||||
checkPendingPublishes: () => dispatch(doCheckPendingPublishesApp()),
|
||||
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
});
|
||||
|
||||
export default withRouter(
|
||||
connect(
|
||||
select,
|
||||
perform
|
||||
)(FileListPublished)
|
||||
);
|
||||
export default withRouter(connect(select, perform)(FileListPublished));
|
||||
|
|
|
@ -10,6 +10,7 @@ import Spinner from 'component/spinner';
|
|||
|
||||
type Props = {
|
||||
checkPendingPublishes: () => void,
|
||||
clearPublish: () => void,
|
||||
fetchClaimListMine: () => void,
|
||||
fetching: boolean,
|
||||
urls: Array<string>,
|
||||
|
@ -19,7 +20,7 @@ type Props = {
|
|||
};
|
||||
|
||||
function FileListPublished(props: Props) {
|
||||
const { checkPendingPublishes, fetchClaimListMine, fetching, urls, urlTotal } = props;
|
||||
const { checkPendingPublishes, clearPublish, fetchClaimListMine, fetching, urls, urlTotal } = props;
|
||||
useEffect(() => {
|
||||
checkPendingPublishes();
|
||||
fetchClaimListMine();
|
||||
|
@ -47,7 +48,12 @@ function FileListPublished(props: Props) {
|
|||
<div className=" section--small">
|
||||
<h2 className="section__title--large">{__('Nothing published to LBRY yet.')}</h2>
|
||||
<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>
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue