clean up publishing on desktop

This commit is contained in:
zeppi 2021-03-29 22:04:14 -04:00 committed by Sean Yesmunt
parent 9468f2b0f2
commit 14685e11af
4 changed files with 20 additions and 2 deletions

View file

@ -1722,5 +1722,7 @@
"Help LBRY Save Crypto": "Help LBRY Save Crypto",
"The US government is attempting to destroy the cryptocurrency industry. Can you help?": "The US government is attempting to destroy the cryptocurrency industry. Can you help?",
"Learn more and sign petition": "Learn more and sign petition",
"Publishing...": "Publishing...",
"Collection": "Collection",
"--end--": "--end--"
}

View file

@ -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';
@ -410,6 +411,14 @@ 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">

View file

@ -43,8 +43,9 @@ class ModalPublishSuccess extends React.PureComponent<Props> {
publishMessage = __('Your file is now pending on LBRY. It will take a few minutes to appear for other users.');
}
clearPublish();
function handleClose() {
clearPublish();
closeModal();
}

View file

@ -79,18 +79,24 @@ const ModalPublishPreview = (props: Props) => {
// $FlowFixMe
previewResponse.outputs[0] && previewResponse.outputs[0].value && !previewResponse.outputs[0].value.source;
// leave the confirm modal up if we're not going straight to upload/reflecting
// @if TARGET='web'
React.useEffect(() => {
if (publishing && IS_WEB && !livestream) {
if (publishing && !livestream) {
closeModal();
} else if (publishSuccess) {
closeModal();
}
}, [publishSuccess, publishing, livestream]);
// @endif
// const waitForSuccess = false;
function onConfirmed() {
// Publish for real:
publish(getFilePathName(filePath), false);
// @if TARGET='app'
closeModal();
// @endif
}
function getFilePathName(filePath: string | WebFile) {