rename uploadStatus -> uploadThumbnailStatus; call doResetThumbnailStatus on componentWillMount

This commit is contained in:
Travis Eden 2018-04-02 09:53:29 -04:00 committed by Sean Yesmunt
parent 1a30e185bd
commit 8def65f1d8
2 changed files with 27 additions and 6 deletions
src/renderer
component/publishForm
redux/reducers

View file

@ -23,7 +23,6 @@ type Props = {
title: ?string, title: ?string,
thumbnail: ?string, thumbnail: ?string,
uploadThumbnailStatus: ?string, uploadThumbnailStatus: ?string,
uploadStatus: ?string,
description: ?string, description: ?string,
language: string, language: string,
nsfw: boolean, nsfw: boolean,
@ -79,6 +78,32 @@ class PublishForm extends React.PureComponent<Props> {
const { resolveUri } = this.props; const { resolveUri } = this.props;
// If they are midway through a channel creation, treat it as anonymous until it completes // If they are midway through a channel creation, treat it as anonymous until it completes
const channelName = channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW ? '' : channel; const channelName = channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW ? '' : channel;
}
componentWillMount() {
this.props.resetThumbnailStatus();
}
handlePublish() {
const {
publish,
filePath,
bid,
title,
thumbnail,
description,
language,
nsfw,
channel,
licenseType,
licenseUrl,
otherLicenseDescription,
copyrightNotice,
name,
contentIsFree,
price,
uri,
} = this.props;
let uri; let uri;
try { try {
@ -275,7 +300,6 @@ class PublishForm extends React.PureComponent<Props> {
title, title,
thumbnail, thumbnail,
uploadThumbnailStatus, uploadThumbnailStatus,
uploadStatus,
description, description,
language, language,
nsfw, nsfw,
@ -365,7 +389,7 @@ class PublishForm extends React.PureComponent<Props> {
updatePublishForm={updatePublishForm} updatePublishForm={updatePublishForm}
formDisabled={formDisabled} formDisabled={formDisabled}
/> />
<p>status: {uploadStatus}</p> <p>status: {uploadThumbnailStatus}</p>
</FormRow> </FormRow>
<FormRow padded> <FormRow padded>
<FormField <FormField

View file

@ -16,7 +16,6 @@ type PublishState = {
title: string, title: string,
thumbnail: string, thumbnail: string,
uploadThumbnailStatus: string, uploadThumbnailStatus: string,
uploadStatus: string,
description: string, description: string,
language: string, language: string,
tosAccepted: boolean, tosAccepted: boolean,
@ -42,7 +41,6 @@ export type UpdatePublishFormData = {
title?: string, title?: string,
thumbnail?: string, thumbnail?: string,
uploadThumbnailStatus?: string, uploadThumbnailStatus?: string,
uploadStatus?: string,
description?: string, description?: string,
language?: string, language?: string,
tosAccepted?: boolean, tosAccepted?: boolean,
@ -102,7 +100,6 @@ const defaultState: PublishState = {
title: '', title: '',
thumbnail: '', thumbnail: '',
uploadThumbnailStatus: STATUSES.API_DOWN, uploadThumbnailStatus: STATUSES.API_DOWN,
uploadStatus: STATUSES.API_DOWN,
description: '', description: '',
language: 'en', language: 'en',
nsfw: false, nsfw: false,