From f5f3bf21ee00d77c4c9dd75ffc7bd9b7c16727e4 Mon Sep 17 00:00:00 2001 From: zeppi Date: Fri, 23 Apr 2021 12:57:51 -0400 Subject: [PATCH] bugfixes --- ui/component/publishFile/view.jsx | 8 ++++---- ui/component/publishForm/index.js | 1 + ui/component/publishForm/view.jsx | 6 ++++-- ui/page/livestreamSetup/view.jsx | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ui/component/publishFile/view.jsx b/ui/component/publishFile/view.jsx index cdc168118..b81959e95 100644 --- a/ui/component/publishFile/view.jsx +++ b/ui/component/publishFile/view.jsx @@ -317,13 +317,13 @@ function PublishFile(props: Props) { // https://github.com/lbryio/lbry-desktop/issues/5855 // publish is trying to use one field to share html file blob and string and such // $FlowFixMe - handleFileChange(false); + handleFileChange(false, false); updatePublishForm({ remoteFileUrl: undefined }); } else if (source === SOURCE_UPLOAD) { updatePublishForm({ remoteFileUrl: undefined }); } else if (source === SOURCE_SELECT) { // $FlowFixMe - handleFileChange(false); + handleFileChange(false, false); if (selectedFileIndex !== null) { updatePublishForm({ remoteFileUrl: livestreamData[selectedFileIndex].data.fileLocation }); } @@ -347,14 +347,14 @@ function PublishFile(props: Props) { } } - function handleFileChange(file: WebFile) { + function handleFileChange(file: WebFile, clearName = true) { const { showToast } = props; window.URL = window.URL || window.webkitURL; setOversized(false); // select file, start to select a new one, then cancel if (!file) { - if (isStillEditing) { + if (isStillEditing || !clearName) { updatePublishForm({ filePath: '' }); } else { updatePublishForm({ filePath: '', name: '' }); diff --git a/ui/component/publishForm/index.js b/ui/component/publishForm/index.js index fda09c8c8..47ed81a46 100644 --- a/ui/component/publishForm/index.js +++ b/ui/component/publishForm/index.js @@ -50,6 +50,7 @@ const select = (state) => { isStillEditing: selectIsStillEditing(state), filePath: makeSelectPublishFormValue('filePath')(state), remoteUrl: makeSelectPublishFormValue('remoteFileUrl')(state), + publishSuccess: makeSelectPublishFormValue('publishSuccess')(state), isResolvingUri: selectIsResolvingPublishUris(state), totalRewardValue: selectUnclaimedRewardValue(state), modal: selectModal(state), diff --git a/ui/component/publishForm/view.jsx b/ui/component/publishForm/view.jsx index f583ec966..f8028f775 100644 --- a/ui/component/publishForm/view.jsx +++ b/ui/component/publishForm/view.jsx @@ -66,6 +66,7 @@ type Props = { licenseUrl: ?string, useLBRYUploader: ?boolean, publishing: boolean, + publishSuccess: boolean, balance: number, isStillEditing: boolean, clearPublish: () => void, @@ -107,6 +108,7 @@ function PublishForm(props: Props) { filePath, fileText, publishing, + publishSuccess, clearPublish, isStillEditing, tags, @@ -315,10 +317,10 @@ function PublishForm(props: Props) { // if you enter the page and it is stuck in publishing, "stop it." useEffect(() => { - if (publishing) { + if (publishing || publishSuccess) { clearPublish(); } - }, []); + }, [clearPublish]); useEffect(() => { if (!thumbnail) { diff --git a/ui/page/livestreamSetup/view.jsx b/ui/page/livestreamSetup/view.jsx index e3f5d5718..5f0cac9ea 100644 --- a/ui/page/livestreamSetup/view.jsx +++ b/ui/page/livestreamSetup/view.jsx @@ -133,7 +133,7 @@ export default function LivestreamSetupPage(props: Props) { {fetchingChannels && (
- +
)} @@ -157,11 +157,11 @@ export default function LivestreamSetupPage(props: Props) { {fetchingLivestreams && !fetchingChannels && !hasLivestreamClaims && (
- +
)}
- {hasLivestreamClaims && !fetchingChannels && channelId && ( + {!fetchingChannels && channelId && ( <> {showHelp && (