Clear 'thumbnailError' when uploading new one

## Issue
"thumbnail is invalid" not reset with new thumbnail upload #6044
https://github.com/lbryio/lbry-desktop/issues/6044

## Change
The previous PR only covered the scenario of changing between NEW and EDIT. This one covers "uploading new".
This commit is contained in:
infiinte-persistence 2021-05-18 01:23:37 +08:00
parent b2ad71fb74
commit ecfcc95beb
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0
2 changed files with 24 additions and 8 deletions

10
dist/bundle.es.js vendored
View file

@ -4634,7 +4634,8 @@ const doResetThumbnailStatus = () => dispatch => {
dispatch({ dispatch({
type: UPDATE_PUBLISH_FORM, type: UPDATE_PUBLISH_FORM,
data: { data: {
thumbnailPath: '' thumbnailPath: '',
thumbnailError: undefined
} }
}); });
@ -4691,6 +4692,13 @@ const doUploadThumbnail = (filePath, thumbnailBlob, fsAdapter, fs, path) => disp
}, doError(error))); }, doError(error)));
}; };
dispatch({
type: UPDATE_PUBLISH_FORM,
data: {
thumbnailError: undefined
}
});
const doUpload = data => { const doUpload = data => {
return fetch(SPEECH_PUBLISH, { return fetch(SPEECH_PUBLISH, {
method: 'POST', method: 'POST',

View file

@ -21,6 +21,7 @@ export const doResetThumbnailStatus = () => (dispatch: Dispatch) => {
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { data: {
thumbnailPath: '', thumbnailPath: '',
thumbnailError: undefined,
}, },
}); });
@ -96,6 +97,13 @@ export const doUploadThumbnail = (
); );
}; };
dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM,
data: {
thumbnailError: undefined,
},
});
const doUpload = data => { const doUpload = data => {
return fetch(SPEECH_PUBLISH, { return fetch(SPEECH_PUBLISH, {
method: 'POST', method: 'POST',
@ -413,7 +421,7 @@ export const doCheckReflectingFiles = () => (dispatch: Dispatch, getState: GetSt
const { checkingReflector } = state.claims; const { checkingReflector } = state.claims;
let reflectorCheckInterval; let reflectorCheckInterval;
const checkFileList = async() => { const checkFileList = async () => {
const state = getState(); const state = getState();
const reflectingById = selectReflectingById(state); const reflectingById = selectReflectingById(state);
const ids = Object.keys(reflectingById); const ids = Object.keys(reflectingById);