From 1911a5132bb7ac411e86074f506fd1f3859e5de4 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 21 Apr 2021 11:30:21 +0800 Subject: [PATCH] PublishFormError: look at 'thumbnail' instead of 'thumbnail_url' I believe the rest of the GUI is setting 'thumbnail'. 'thumbnail_url' is only populated right before publishing. So, the flag was always false -- we just never see the error on screen because the component is incorrectly hidden (fix for this is coming up next...) --- ui/component/publishFormErrors/index.js | 2 +- ui/component/publishFormErrors/view.jsx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ui/component/publishFormErrors/index.js b/ui/component/publishFormErrors/index.js index 5197f54ca..651ed5991 100644 --- a/ui/component/publishFormErrors/index.js +++ b/ui/component/publishFormErrors/index.js @@ -9,7 +9,7 @@ const select = (state) => ({ bidError: makeSelectPublishFormValue('bidError')(state), editingURI: makeSelectPublishFormValue('editingURI')(state), uploadThumbnailStatus: makeSelectPublishFormValue('uploadThumbnailStatus')(state), - thumbnail: makeSelectPublishFormValue('thumbnail_url')(state), + thumbnail: makeSelectPublishFormValue('thumbnail')(state), isStillEditing: selectIsStillEditing(state), }); diff --git a/ui/component/publishFormErrors/view.jsx b/ui/component/publishFormErrors/view.jsx index dddb583ca..069629351 100644 --- a/ui/component/publishFormErrors/view.jsx +++ b/ui/component/publishFormErrors/view.jsx @@ -31,6 +31,9 @@ function PublishFormErrors(props: Props) { } = props; // These are extra help // If there is an error it will be presented as an inline error as well + + const isUploadingThumbnail = uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS; + return (
{waitForFile &&
{__('Choose a replay file, or select None')}
} @@ -39,10 +42,10 @@ function PublishFormErrors(props: Props) { {!isNameValid(name, false) && INVALID_NAME_ERROR} {!bid &&
{__('A deposit amount is required')}
} {bidError &&
{__('Please check your deposit amount.')}
} - {uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS && ( -
{__('Please wait for thumbnail to finish uploading')}
+ {isUploadingThumbnail &&
{__('Please wait for thumbnail to finish uploading')}
} + {!isUploadingThumbnail && !thumbnail && ( +
{__('A thumbnail is required. Please upload or provide an image URL above.')}
)} - {!thumbnail &&
{__('A thumbnail is required. Please upload or provide an image URL above.')}
} {editingURI && !isStillEditing && !filePath && (
{__('Please reselect a file after changing the LBRY URL')}
)}