mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
bugfixes
This commit is contained in:
parent
f3463ebdeb
commit
f5f3bf21ee
4 changed files with 12 additions and 9 deletions
|
@ -317,13 +317,13 @@ function PublishFile(props: Props) {
|
||||||
// https://github.com/lbryio/lbry-desktop/issues/5855
|
// https://github.com/lbryio/lbry-desktop/issues/5855
|
||||||
// publish is trying to use one field to share html file blob and string and such
|
// publish is trying to use one field to share html file blob and string and such
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
handleFileChange(false);
|
handleFileChange(false, false);
|
||||||
updatePublishForm({ remoteFileUrl: undefined });
|
updatePublishForm({ remoteFileUrl: undefined });
|
||||||
} else if (source === SOURCE_UPLOAD) {
|
} else if (source === SOURCE_UPLOAD) {
|
||||||
updatePublishForm({ remoteFileUrl: undefined });
|
updatePublishForm({ remoteFileUrl: undefined });
|
||||||
} else if (source === SOURCE_SELECT) {
|
} else if (source === SOURCE_SELECT) {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
handleFileChange(false);
|
handleFileChange(false, false);
|
||||||
if (selectedFileIndex !== null) {
|
if (selectedFileIndex !== null) {
|
||||||
updatePublishForm({ remoteFileUrl: livestreamData[selectedFileIndex].data.fileLocation });
|
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;
|
const { showToast } = props;
|
||||||
window.URL = window.URL || window.webkitURL;
|
window.URL = window.URL || window.webkitURL;
|
||||||
setOversized(false);
|
setOversized(false);
|
||||||
|
|
||||||
// select file, start to select a new one, then cancel
|
// select file, start to select a new one, then cancel
|
||||||
if (!file) {
|
if (!file) {
|
||||||
if (isStillEditing) {
|
if (isStillEditing || !clearName) {
|
||||||
updatePublishForm({ filePath: '' });
|
updatePublishForm({ filePath: '' });
|
||||||
} else {
|
} else {
|
||||||
updatePublishForm({ filePath: '', name: '' });
|
updatePublishForm({ filePath: '', name: '' });
|
||||||
|
|
|
@ -50,6 +50,7 @@ const select = (state) => {
|
||||||
isStillEditing: selectIsStillEditing(state),
|
isStillEditing: selectIsStillEditing(state),
|
||||||
filePath: makeSelectPublishFormValue('filePath')(state),
|
filePath: makeSelectPublishFormValue('filePath')(state),
|
||||||
remoteUrl: makeSelectPublishFormValue('remoteFileUrl')(state),
|
remoteUrl: makeSelectPublishFormValue('remoteFileUrl')(state),
|
||||||
|
publishSuccess: makeSelectPublishFormValue('publishSuccess')(state),
|
||||||
isResolvingUri: selectIsResolvingPublishUris(state),
|
isResolvingUri: selectIsResolvingPublishUris(state),
|
||||||
totalRewardValue: selectUnclaimedRewardValue(state),
|
totalRewardValue: selectUnclaimedRewardValue(state),
|
||||||
modal: selectModal(state),
|
modal: selectModal(state),
|
||||||
|
|
|
@ -66,6 +66,7 @@ type Props = {
|
||||||
licenseUrl: ?string,
|
licenseUrl: ?string,
|
||||||
useLBRYUploader: ?boolean,
|
useLBRYUploader: ?boolean,
|
||||||
publishing: boolean,
|
publishing: boolean,
|
||||||
|
publishSuccess: boolean,
|
||||||
balance: number,
|
balance: number,
|
||||||
isStillEditing: boolean,
|
isStillEditing: boolean,
|
||||||
clearPublish: () => void,
|
clearPublish: () => void,
|
||||||
|
@ -107,6 +108,7 @@ function PublishForm(props: Props) {
|
||||||
filePath,
|
filePath,
|
||||||
fileText,
|
fileText,
|
||||||
publishing,
|
publishing,
|
||||||
|
publishSuccess,
|
||||||
clearPublish,
|
clearPublish,
|
||||||
isStillEditing,
|
isStillEditing,
|
||||||
tags,
|
tags,
|
||||||
|
@ -315,10 +317,10 @@ function PublishForm(props: Props) {
|
||||||
|
|
||||||
// if you enter the page and it is stuck in publishing, "stop it."
|
// if you enter the page and it is stuck in publishing, "stop it."
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (publishing) {
|
if (publishing || publishSuccess) {
|
||||||
clearPublish();
|
clearPublish();
|
||||||
}
|
}
|
||||||
}, []);
|
}, [clearPublish]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!thumbnail) {
|
if (!thumbnail) {
|
||||||
|
|
|
@ -133,7 +133,7 @@ export default function LivestreamSetupPage(props: Props) {
|
||||||
<Page>
|
<Page>
|
||||||
{fetchingChannels && (
|
{fetchingChannels && (
|
||||||
<div className="main--empty">
|
<div className="main--empty">
|
||||||
<Spinner />
|
<Spinner delayed />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -157,11 +157,11 @@ export default function LivestreamSetupPage(props: Props) {
|
||||||
|
|
||||||
{fetchingLivestreams && !fetchingChannels && !hasLivestreamClaims && (
|
{fetchingLivestreams && !fetchingChannels && !hasLivestreamClaims && (
|
||||||
<div className="main--empty">
|
<div className="main--empty">
|
||||||
<Spinner />
|
<Spinner delayed />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="card-stack">
|
<div className="card-stack">
|
||||||
{hasLivestreamClaims && !fetchingChannels && channelId && (
|
{!fetchingChannels && channelId && (
|
||||||
<>
|
<>
|
||||||
{showHelp && (
|
{showHelp && (
|
||||||
<Card
|
<Card
|
||||||
|
|
Loading…
Add table
Reference in a new issue