proper naming; set thumbnail='' and nsfw=false

This commit is contained in:
Travis Eden 2018-04-02 12:05:14 -04:00 committed by Sean Yesmunt
parent f5be93b6b5
commit 85e8c78ee5

View file

@ -38,13 +38,21 @@ export const doResetThumbnailStatus = () => (dispatch: Dispatch): Action =>
.then(() => .then(() =>
dispatch({ dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { uploadThumbnailStatus: STATUSES.READY }, data: {
uploadThumbnailStatus: STATUSES.READY,
thumbnail: '',
nsfw: false,
},
}) })
) )
.catch(() => .catch(() =>
dispatch({ dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { uploadThumbnailStatus: STATUSES.API_DOWN }, data: {
uploadThumbnailStatus: STATUSES.API_DOWN,
thumbnail: '',
nsfw: false,
},
}) })
); );
@ -64,7 +72,7 @@ export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch:
batchActions( batchActions(
{ {
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { thumbnailStatus: STATUSES.DOWN }, data: { uploadThumbnailStatus: STATUSES.DOWN },
}, },
doAlertError(error) doAlertError(error)
) )
@ -72,7 +80,7 @@ export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch:
dispatch({ dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { thumbnailStatus: STATUSES.IN_PROGRESS }, data: { uploadThumbnailStatus: STATUSES.IN_PROGRESS },
}); });
const data = new FormData(); const data = new FormData();
@ -92,8 +100,8 @@ export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch:
? dispatch({ ? dispatch({
type: ACTIONS.UPDATE_PUBLISH_FORM, type: ACTIONS.UPDATE_PUBLISH_FORM,
data: { data: {
thumbnailStatus: STATUSES.COMPLETE, uploadThumbnailStatus: STATUSES.COMPLETE,
thumbnailUrl: `${json.data.url}${fileExt}`, thumbnail: `${json.data.url}${fileExt}`,
}, },
}) })
: uploadError() : uploadError()