diff --git a/src/renderer/component/publishForm/view.jsx b/src/renderer/component/publishForm/view.jsx index 0da85023c..8118e5b0b 100644 --- a/src/renderer/component/publishForm/view.jsx +++ b/src/renderer/component/publishForm/view.jsx @@ -38,6 +38,11 @@ type Props = { winningBidForClaimUri: number, myClaimForUri: ?{ amount: number, + value: { + stream: { + source: { source: string }, + }, + }, }, licenseType: string, otherLicenseDescription: ?string, @@ -187,6 +192,7 @@ class PublishForm extends React.PureComponent { contentIsFree, price, uri, + myClaimForUri, } = this.props; let publishingLicense; @@ -222,6 +228,12 @@ class PublishForm extends React.PureComponent { uri, }; + // Editing a claim + if (!filePath && myClaimForUri) { + const { source } = myClaimForUri.value.stream; + publishParams.source = source; + } + publish(publishParams); } diff --git a/src/renderer/redux/actions/publish.js b/src/renderer/redux/actions/publish.js index ba0da04b8..a66cfbe77 100644 --- a/src/renderer/redux/actions/publish.js +++ b/src/renderer/redux/actions/publish.js @@ -84,6 +84,7 @@ export const doPublish = (params: PublishParams): ThunkAction => { contentIsFree, price, uri, + source, } = params; const channelName = channel === CHANNEL_ANONYMOUS || channel === CHANNEL_NEW ? '' : channel; @@ -107,13 +108,18 @@ export const doPublish = (params: PublishParams): ThunkAction => { } const publishPayload = { - file_path: filePath, name, channel_name: channelName, bid, metadata, }; + if (filePath) { + publishPayload.file_path = filePath; + } else { + publishPayload.sources = source; + } + return (dispatch: Dispatch) => { dispatch({ type: ACTIONS.PUBLISH_START }); diff --git a/src/renderer/redux/reducers/publish.js b/src/renderer/redux/reducers/publish.js index 195e8c6cf..8bc91918b 100644 --- a/src/renderer/redux/reducers/publish.js +++ b/src/renderer/redux/reducers/publish.js @@ -75,6 +75,12 @@ export type PublishParams = { currency: string, amount: number, }, + source?: { + contentType: string, + source: string, + sourceType: string, + version: string, + }, }; const defaultState: PublishState = {