lbry-desktop/ui/modal/modalDownloading/index.js
2022-02-17 15:45:35 -05:00

20 lines
748 B
JavaScript

import { connect } from 'react-redux';
import { doStartUpgrade, doCancelUpgrade, doHideModal } from 'redux/actions/app';
import { selectDownloadProgress, selectDownloadComplete, selectUpgradeDownloadPath } from 'redux/selectors/app';
import ModalDownloading from './view';
const select = (state) => ({
downloadProgress: selectDownloadProgress(state),
downloadComplete: selectDownloadComplete(state),
downloadItem: selectUpgradeDownloadPath(state), // update or clear this when download (Re)starts
});
const perform = (dispatch) => ({
startUpgrade: () => dispatch(doStartUpgrade()),
cancelUpgrade: () => {
dispatch(doHideModal());
dispatch(doCancelUpgrade());
},
});
export default connect(select, perform)(ModalDownloading);