This commit is contained in:
zeppi 2021-04-23 12:57:51 -04:00 committed by Sean Yesmunt
parent f3463ebdeb
commit f5f3bf21ee
4 changed files with 12 additions and 9 deletions

View file

@ -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: '' });

View file

@ -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),

View file

@ -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) {

View file

@ -133,7 +133,7 @@ export default function LivestreamSetupPage(props: Props) {
<Page>
{fetchingChannels && (
<div className="main--empty">
<Spinner />
<Spinner delayed />
</div>
)}
@ -157,11 +157,11 @@ export default function LivestreamSetupPage(props: Props) {
{fetchingLivestreams && !fetchingChannels && !hasLivestreamClaims && (
<div className="main--empty">
<Spinner />
<Spinner delayed />
</div>
)}
<div className="card-stack">
{hasLivestreamClaims && !fetchingChannels && channelId && (
{!fetchingChannels && channelId && (
<>
{showHelp && (
<Card