final please
This commit is contained in:
parent
6b705c995a
commit
441f13979d
4 changed files with 18 additions and 6 deletions
|
@ -26,6 +26,7 @@ import Card from 'component/common/card';
|
|||
import I18nMessage from 'component/i18nMessage';
|
||||
import * as PUBLISH_MODES from 'constants/publish_types';
|
||||
import { useHistory } from 'react-router';
|
||||
import Spinner from 'component/spinner';
|
||||
|
||||
// @if TARGET='app'
|
||||
import fs from 'fs';
|
||||
|
@ -403,6 +404,15 @@ function PublishForm(props: Props) {
|
|||
}
|
||||
}, [autoSwitchMode, editingURI, fileMimeType, myClaimForUri, mode, setMode, setAutoSwitchMode]);
|
||||
|
||||
if (publishing) {
|
||||
return (
|
||||
<div className="main--empty">
|
||||
<h1 className="section__subtitle">{__('Publishing...')}</h1>
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Editing claim uri
|
||||
return (
|
||||
<div className="card-stack">
|
||||
|
|
|
@ -42,9 +42,9 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
|
|||
} else {
|
||||
publishMessage = __('Your video will appear on Odysee shortly.');
|
||||
}
|
||||
clearPublish();
|
||||
|
||||
function handleClose() {
|
||||
clearPublish();
|
||||
closeModal();
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import {
|
|||
selectIsStillEditing,
|
||||
selectMyChannelClaims,
|
||||
SETTINGS,
|
||||
doClearPublish,
|
||||
} from 'lbry-redux';
|
||||
import { selectFfmpegStatus, makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { doPublishDesktop } from 'redux/actions/publish';
|
||||
|
@ -25,6 +26,7 @@ const select = (state) => ({
|
|||
|
||||
const perform = (dispatch) => ({
|
||||
publish: (filePath, preview) => dispatch(doPublishDesktop(filePath, preview)),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
closeModal: () => dispatch(doHideModal()),
|
||||
setEnablePublishPreview: (value) => dispatch(doSetClientSetting(SETTINGS.ENABLE_PUBLISH_PREVIEW, value)),
|
||||
});
|
||||
|
|
|
@ -43,6 +43,7 @@ type Props = {
|
|||
myChannels: ?Array<ChannelClaim>,
|
||||
publishSuccess: boolean,
|
||||
publishing: boolean,
|
||||
clearPublish: () => void,
|
||||
};
|
||||
|
||||
// class ModalPublishPreview extends React.PureComponent<Props> {
|
||||
|
@ -74,27 +75,26 @@ const ModalPublishPreview = (props: Props) => {
|
|||
publishing,
|
||||
publish,
|
||||
closeModal,
|
||||
clearPublish,
|
||||
} = props;
|
||||
const livestream =
|
||||
// $FlowFixMe
|
||||
previewResponse.outputs[0] && previewResponse.outputs[0].value && !previewResponse.outputs[0].value.source;
|
||||
// @if TARGET='web'
|
||||
React.useEffect(() => {
|
||||
console.log('publishSuccess', publishSuccess);
|
||||
if (publishing && !livestream) {
|
||||
console.log('doPublishing');
|
||||
closeModal();
|
||||
}
|
||||
if (publishSuccess && livestream) {
|
||||
console.log('doPublishSuccess');
|
||||
clearPublish();
|
||||
closeModal();
|
||||
}
|
||||
}, [publishSuccess, publishing, livestream]);
|
||||
|
||||
// @endif
|
||||
// const waitForSuccess = false;
|
||||
function onConfirmed() {
|
||||
// Publish for real:
|
||||
publish(getFilePathName(filePath), false);
|
||||
console.log('filePAath', filePath);
|
||||
}
|
||||
|
||||
function getFilePathName(filePath: string | WebFile) {
|
||||
|
|
Loading…
Reference in a new issue