From 85e8c78ee5a63e3d2e6b10b006a105e401b0daff Mon Sep 17 00:00:00 2001 From: Travis Eden Date: Mon, 2 Apr 2018 12:05:14 -0400 Subject: [PATCH] proper naming; set thumbnail='' and nsfw=false --- src/renderer/redux/actions/publish.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index b733717e8..79103effc 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -38,13 +38,21 @@ export const doResetThumbnailStatus = () => (dispatch: Dispatch): Action => .then(() => dispatch({ type: ACTIONS.UPDATE_PUBLISH_FORM, - data: { uploadThumbnailStatus: STATUSES.READY }, + data: { + uploadThumbnailStatus: STATUSES.READY, + thumbnail: '', + nsfw: false, + }, }) ) .catch(() => dispatch({ 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( { type: ACTIONS.UPDATE_PUBLISH_FORM, - data: { thumbnailStatus: STATUSES.DOWN }, + data: { uploadThumbnailStatus: STATUSES.DOWN }, }, doAlertError(error) ) @@ -72,7 +80,7 @@ export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch: dispatch({ type: ACTIONS.UPDATE_PUBLISH_FORM, - data: { thumbnailStatus: STATUSES.IN_PROGRESS }, + data: { uploadThumbnailStatus: STATUSES.IN_PROGRESS }, }); const data = new FormData(); @@ -92,8 +100,8 @@ export const doUploadThumbnail = (filePath: string, nsfw: boolean) => (dispatch: ? dispatch({ type: ACTIONS.UPDATE_PUBLISH_FORM, data: { - thumbnailStatus: STATUSES.COMPLETE, - thumbnailUrl: `${json.data.url}${fileExt}`, + uploadThumbnailStatus: STATUSES.COMPLETE, + thumbnail: `${json.data.url}${fileExt}`, }, }) : uploadError()