fix: allow metadata only edits
This commit is contained in:
parent
91c6764d31
commit
402bba5835
3 changed files with 25 additions and 1 deletions
|
@ -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<Props> {
|
|||
contentIsFree,
|
||||
price,
|
||||
uri,
|
||||
myClaimForUri,
|
||||
} = this.props;
|
||||
|
||||
let publishingLicense;
|
||||
|
@ -222,6 +228,12 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
uri,
|
||||
};
|
||||
|
||||
// Editing a claim
|
||||
if (!filePath && myClaimForUri) {
|
||||
const { source } = myClaimForUri.value.stream;
|
||||
publishParams.source = source;
|
||||
}
|
||||
|
||||
publish(publishParams);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 });
|
||||
|
||||
|
|
|
@ -75,6 +75,12 @@ export type PublishParams = {
|
|||
currency: string,
|
||||
amount: number,
|
||||
},
|
||||
source?: {
|
||||
contentType: string,
|
||||
source: string,
|
||||
sourceType: string,
|
||||
version: string,
|
||||
},
|
||||
};
|
||||
|
||||
const defaultState: PublishState = {
|
||||
|
|
Loading…
Reference in a new issue