From 65d80f779faa34462aa17801aa3b4d3eb25b2d60 Mon Sep 17 00:00:00 2001 From: Thomas Zarebczan Date: Fri, 10 May 2019 00:13:17 -0400 Subject: [PATCH] fixes fix refresh on edit page fix publish without tags --- src/ui/component/publishForm/view.jsx | 2 +- src/ui/redux/actions/publish.js | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ui/component/publishForm/view.jsx b/src/ui/component/publishForm/view.jsx index 936088d82..071ae74c1 100644 --- a/src/ui/component/publishForm/view.jsx +++ b/src/ui/component/publishForm/view.jsx @@ -446,7 +446,7 @@ class PublishForm extends React.PureComponent { onChange={newFee => updatePublishForm({ fee: newFee })} /> )} - {fee.currency !== 'LBC' && ( + {fee && fee.currency !== 'LBC' && (

{__( '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.' diff --git a/src/ui/redux/actions/publish.js b/src/ui/redux/actions/publish.js index d82ef4c40..f02b56745 100644 --- a/src/ui/redux/actions/publish.js +++ b/src/ui/redux/actions/publish.js @@ -222,11 +222,11 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat channel_id?: string, bid: number, file_path?: string, - tags: Array, + tags?: Array, locations?: Array, - license_url: string, - thumbnail_url: string, - release_time: number, + license_url?: string, + thumbnail_url?: string, + release_time?: number, } = { name, bid: creditsToString(bid), @@ -234,8 +234,8 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat license, languages: [language], description, - tags: claim.value.tags, - locations: claim.value.locations, + tags: claim && claim.value.tags, + locations: claim && claim.value.locations, }; // 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; } - if (claim.value.release_time) { - publishPayload.release_time = Number(claim.value.release_time); + if (claim && claim.value.release_time) { + publishPayload.release_time = claim && Number(claim.value.release_time); } if (nsfw) { @@ -259,7 +259,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat publishPayload.tags.push('mature'); } } else { - const remove = publishPayload.tags.indexOf('mature'); + const remove = publishPayload.tags && publishPayload.tags.indexOf('mature'); if (remove > -1) { publishPayload.tags.splice(remove, 1); }