fix flow errors

This commit is contained in:
Sean Yesmunt 2019-05-10 10:50:33 -04:00
parent 4f9f62f999
commit 22302991c8
5 changed files with 13 additions and 18 deletions

View file

@ -24,6 +24,7 @@
"rules": {
"comma-dangle": ["error", "always-multiline"],
"handle-callback-err": 0,
"indent": 0,
"jsx-quotes": ["error", "prefer-double"],
"new-cap": 0,
"no-multi-spaces": 0,

View file

@ -4,7 +4,7 @@ declare type UpdatePublishFormData = {
filePath?: string,
contentIsFree?: boolean,
fee?: {
amount: string,
amount: number,
currency: string,
},
title?: string,
@ -46,8 +46,6 @@ declare type PublishParams = {
amount: string,
currency: string,
},
feeCurrency: string,
feeAmount: string,
claim: StreamClaim,
nsfw: boolean,
};

View file

@ -117,7 +117,7 @@
"jsmediatags": "^3.8.1",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#423123f1c19e61cead67c745d0892a2e4481cb6a",
"lbry-redux": "lbryio/lbry-redux#c8126ab21792d7a85e1123a2363af285a0263654",
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -48,10 +48,9 @@ class ModalRemoveFile extends React.PureComponent<Props, State> {
render() {
const { claim, claimIsMine, closeModal, deleteFile, fileInfo, title } = this.props;
const { deleteChecked, abandonClaimChecked } = this.state;
const { txid, nout } = claim;
const outpoint = fileInfo ? fileInfo.outpoint : `${txid}:${nout}`;
return (
<Modal
isOpen

View file

@ -160,14 +160,9 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string) => (dispatch: Dis
uri,
uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined,
licenseUrl,
nsfw: isClaimNsfw(claim),
};
if (claim && isClaimNsfw(claim)) {
publishData.nsfw = true;
} else {
publishData.nsfw = false;
}
// Make sure custom liscence's are mapped properly
// If the license isn't one of the standard licenses, map the custom license and description/url
if (!CC_LICENSES.some(({ value }) => value === license)) {
@ -221,11 +216,13 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
channel_id?: string,
bid: number,
file_path?: string,
tags?: Array<string>,
tags: Array<string>,
locations?: Array<Location>,
license_url?: string,
thumbnail_url?: string,
release_time?: number,
fee_currency?: string,
fee_amount?: string,
} = {
name,
bid: creditsToString(bid),
@ -250,7 +247,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
}
if (claim && claim.value.release_time) {
publishPayload.release_time = claim && Number(claim.value.release_time);
publishPayload.release_time = Number(claim.value.release_time);
}
if (nsfw) {
@ -258,9 +255,9 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
publishPayload.tags.push('mature');
}
} else {
const remove = publishPayload.tags.indexOf('mature');
if (remove > -1) {
publishPayload.tags.splice(remove, 1);
const indexToRemove = publishPayload.tags.indexOf('mature');
if (indexToRemove > -1) {
publishPayload.tags.splice(indexToRemove, 1);
}
}
@ -268,7 +265,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
publishPayload.channel_id = channelId;
}
if (!contentIsFree && (fee.currency && Number(fee.amount) > 0)) {
if (!contentIsFree && fee && (fee.currency && Number(fee.amount) > 0)) {
publishPayload.fee_currency = fee.currency;
publishPayload.fee_amount = creditsToString(fee.amount);
}