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