2020-08-13 21:06:43 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doHideModal } from 'redux/actions/app';
|
|
|
|
import ModalPublishPreview from './view';
|
2020-08-12 03:24:41 +02:00
|
|
|
import {
|
|
|
|
makeSelectPublishFormValue,
|
|
|
|
selectPublishFormValues,
|
|
|
|
selectIsStillEditing,
|
2021-03-21 09:38:54 +01:00
|
|
|
selectMyChannelClaims,
|
2020-08-12 03:24:41 +02:00
|
|
|
SETTINGS,
|
|
|
|
} from 'lbry-redux';
|
2020-08-11 11:54:09 +02:00
|
|
|
import { selectFfmpegStatus, makeSelectClientSetting } from 'redux/selectors/settings';
|
2020-08-13 21:06:43 +02:00
|
|
|
import { doPublishDesktop } from 'redux/actions/publish';
|
2020-08-11 11:54:09 +02:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2020-08-13 21:06:43 +02:00
|
|
|
|
2021-03-21 09:38:54 +01:00
|
|
|
const select = (state) => ({
|
2020-08-13 21:06:43 +02:00
|
|
|
...selectPublishFormValues(state),
|
2021-03-21 09:38:54 +01:00
|
|
|
myChannels: selectMyChannelClaims(state),
|
2020-08-13 21:06:43 +02:00
|
|
|
isVid: makeSelectPublishFormValue('fileVid')(state),
|
2021-03-30 01:05:18 +02:00
|
|
|
publishSuccess: makeSelectPublishFormValue('publishSuccess')(state),
|
|
|
|
publishing: makeSelectPublishFormValue('publishing')(state),
|
2020-08-12 03:24:41 +02:00
|
|
|
isStillEditing: selectIsStillEditing(state),
|
2020-08-13 21:06:43 +02:00
|
|
|
ffmpegStatus: selectFfmpegStatus(state),
|
2020-08-11 11:54:09 +02:00
|
|
|
enablePublishPreview: makeSelectClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW)(state),
|
2020-08-13 21:06:43 +02:00
|
|
|
});
|
|
|
|
|
2021-03-21 09:38:54 +01:00
|
|
|
const perform = (dispatch) => ({
|
2020-08-13 21:06:43 +02:00
|
|
|
publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)),
|
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2021-03-21 09:38:54 +01:00
|
|
|
setEnablePublishPreview: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, value)),
|
2020-08-13 21:06:43 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(ModalPublishPreview);
|