fix refresh on edit page
fix publish without tags
This commit is contained in:
Thomas Zarebczan 2019-05-10 00:13:17 -04:00
parent 264dda4a85
commit 65d80f779f
2 changed files with 10 additions and 10 deletions

View file

@ -446,7 +446,7 @@ class PublishForm extends React.PureComponent<Props> {
onChange={newFee => updatePublishForm({ fee: newFee })} onChange={newFee => updatePublishForm({ fee: newFee })}
/> />
)} )}
{fee.currency !== 'LBC' && ( {fee && fee.currency !== 'LBC' && (
<p className="form-field__help"> <p className="form-field__help">
{__( {__(
'All content fees are charged in LBC. For non-LBC payment methods, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase.' 'All content fees are charged in LBC. For non-LBC payment methods, the number of credits charged will be adjusted based on the value of LBRY credits at the time of purchase.'

View file

@ -222,11 +222,11 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
channel_id?: string, channel_id?: string,
bid: number, bid: number,
file_path?: string, file_path?: string,
tags: Array<string>, tags?: Array<string>,
locations?: Array<Location>, locations?: Array<Location>,
license_url: string, license_url?: string,
thumbnail_url: string, thumbnail_url?: string,
release_time: number, release_time?: number,
} = { } = {
name, name,
bid: creditsToString(bid), bid: creditsToString(bid),
@ -234,8 +234,8 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
license, license,
languages: [language], languages: [language],
description, description,
tags: claim.value.tags, tags: claim && claim.value.tags,
locations: claim.value.locations, locations: claim && claim.value.locations,
}; };
// Temporary solution to keep the same publish flow with the new tags api // Temporary solution to keep the same publish flow with the new tags api
@ -250,8 +250,8 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
publishPayload.thumbnail_url = thumbnail; publishPayload.thumbnail_url = thumbnail;
} }
if (claim.value.release_time) { if (claim && claim.value.release_time) {
publishPayload.release_time = Number(claim.value.release_time); publishPayload.release_time = claim && Number(claim.value.release_time);
} }
if (nsfw) { if (nsfw) {
@ -259,7 +259,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
publishPayload.tags.push('mature'); publishPayload.tags.push('mature');
} }
} else { } else {
const remove = publishPayload.tags.indexOf('mature'); const remove = publishPayload.tags && publishPayload.tags.indexOf('mature');
if (remove > -1) { if (remove > -1) {
publishPayload.tags.splice(remove, 1); publishPayload.tags.splice(remove, 1);
} }