From 14685e11af62e1c20e0d1c859b4ee35aed4fc5ef Mon Sep 17 00:00:00 2001 From: zeppi Date: Mon, 29 Mar 2021 22:04:14 -0400 Subject: [PATCH] clean up publishing on desktop --- static/app-strings.json | 2 ++ ui/component/publishForm/view.jsx | 9 +++++++++ ui/modal/modalPublish/view.jsx | 3 ++- ui/modal/modalPublishPreview/view.jsx | 8 +++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 03367c92d..d4b9783fa 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -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--" } diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index 684144931..f90aad531 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -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 ( +
+

{__('Publishing...')}

+ +
+ ); + } // Editing claim uri return (
diff --git a/ui/modal/modalPublish/view.jsx b/ui/modal/modalPublish/view.jsx index 6f821a94d..9caa98b0c 100644 --- a/ui/modal/modalPublish/view.jsx +++ b/ui/modal/modalPublish/view.jsx @@ -43,8 +43,9 @@ class ModalPublishSuccess extends React.PureComponent { publishMessage = __('Your file is now pending on LBRY. It will take a few minutes to appear for other users.'); } + clearPublish(); + function handleClose() { - clearPublish(); closeModal(); } diff --git a/ui/modal/modalPublishPreview/view.jsx b/ui/modal/modalPublishPreview/view.jsx index 3c7d02bb1..ca55d498c 100644 --- a/ui/modal/modalPublishPreview/view.jsx +++ b/ui/modal/modalPublishPreview/view.jsx @@ -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) {