Merge pull request #2471 from lbryio/fix-mature-checkbox
moar release fixes
This commit is contained in:
commit
d6c4463c99
12 changed files with 80 additions and 65 deletions
|
@ -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,
|
||||
|
|
BIN
build/icon.ico
Normal file
BIN
build/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
11
flow-typed/publish.js
vendored
11
flow-typed/publish.js
vendored
|
@ -3,7 +3,7 @@
|
|||
declare type UpdatePublishFormData = {
|
||||
filePath?: string,
|
||||
contentIsFree?: boolean,
|
||||
price?: {
|
||||
fee?: {
|
||||
amount: number,
|
||||
currency: string,
|
||||
},
|
||||
|
@ -23,7 +23,7 @@ declare type UpdatePublishFormData = {
|
|||
licenseUrl?: string,
|
||||
licenseType?: string,
|
||||
uri?: string,
|
||||
replace?: boolean,
|
||||
nsfw: boolean,
|
||||
};
|
||||
|
||||
declare type PublishParams = {
|
||||
|
@ -43,12 +43,9 @@ declare type PublishParams = {
|
|||
license: ?string,
|
||||
licenseUrl: ?string,
|
||||
fee?: {
|
||||
amount: string,
|
||||
currency: string,
|
||||
amount: number,
|
||||
},
|
||||
replace?: boolean,
|
||||
|
||||
// This is bad.
|
||||
// Will be removed for tags soon
|
||||
claim: StreamClaim,
|
||||
nsfw: boolean,
|
||||
};
|
||||
|
|
|
@ -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#32916b04e4888c06a9bb2b07c57ce6821a4acf1a",
|
||||
"lbry-redux": "lbryio/lbry-redux#c8126ab21792d7a85e1123a2363af285a0263654",
|
||||
"lbryinc": "lbryio/lbryinc#43d382d9b74d396a581a74d87e4c53105e04f845",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import path from 'path';
|
||||
import { app, BrowserWindow, dialog, shell, screen } from 'electron';
|
||||
import isDev from 'electron-is-dev';
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
|
@ -28,7 +27,7 @@ export default appState => {
|
|||
// If state is undefined, create window as maximized.
|
||||
width: windowState.width === undefined ? width : windowState.width,
|
||||
height: windowState.height === undefined ? height : windowState.height,
|
||||
icon: 'static/img/tray/default/tray.png',
|
||||
icon: 'static/img/tray/windows/tray.png',
|
||||
webPreferences: {
|
||||
// Disable renderer process's webSecurity on development to enable CORS.
|
||||
webSecurity: !isDev,
|
||||
|
|
|
@ -28,7 +28,7 @@ type Props = {
|
|||
language: string,
|
||||
nsfw: boolean,
|
||||
contentIsFree: boolean,
|
||||
price: {
|
||||
fee: {
|
||||
amount: number,
|
||||
currency: string,
|
||||
},
|
||||
|
@ -71,10 +71,13 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { thumbnail } = this.props;
|
||||
const { thumbnail, name, channel, editingURI } = this.props;
|
||||
if (!thumbnail) {
|
||||
this.props.resetThumbnailStatus();
|
||||
}
|
||||
if (editingURI) {
|
||||
this.getNewUri(name, channel);
|
||||
}
|
||||
}
|
||||
|
||||
getNewUri(name: string, channel: string) {
|
||||
|
@ -156,7 +159,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
|
||||
let previousBidAmount = 0;
|
||||
if (myClaimForUri) {
|
||||
previousBidAmount = myClaimForUri.amount;
|
||||
previousBidAmount = Number(myClaimForUri.amount);
|
||||
}
|
||||
|
||||
const totalAvailableBidAmount = previousBidAmount + balance;
|
||||
|
@ -217,10 +220,11 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
otherLicenseDescription,
|
||||
name: this.props.name || undefined,
|
||||
contentIsFree: this.props.contentIsFree,
|
||||
price: this.props.price,
|
||||
fee: this.props.fee,
|
||||
uri: this.props.uri || undefined,
|
||||
channel: this.props.channel,
|
||||
isStillEditing: this.props.isStillEditing,
|
||||
claim: this.props.myClaimForUri,
|
||||
};
|
||||
|
||||
publish(publishParams);
|
||||
|
@ -292,7 +296,7 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
language,
|
||||
nsfw,
|
||||
contentIsFree,
|
||||
price,
|
||||
fee,
|
||||
channel,
|
||||
name,
|
||||
updatePublishForm,
|
||||
|
@ -440,11 +444,11 @@ class PublishForm extends React.PureComponent<Props> {
|
|||
<FormFieldPrice
|
||||
name="content_cost_amount"
|
||||
min="0"
|
||||
price={price}
|
||||
onChange={newPrice => updatePublishForm({ price: newPrice })}
|
||||
price={fee}
|
||||
onChange={newFee => updatePublishForm({ fee: newFee })}
|
||||
/>
|
||||
)}
|
||||
{price.currency !== 'LBC' && (
|
||||
{fee && fee.currency !== 'LBC' && (
|
||||
<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.'
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { doDeleteFileAndMaybeGoBack } from 'redux/actions/file';
|
||||
import { makeSelectTitleForUri, makeSelectClaimIsMine, makeSelectFileInfoForUri } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectTitleForUri,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectFileInfoForUri,
|
||||
makeSelectClaimForUri,
|
||||
} from 'lbry-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import ModalRemoveFile from './view';
|
||||
|
||||
|
@ -8,6 +13,7 @@ const select = (state, props) => ({
|
|||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
fileInfo: makeSelectFileInfoForUri(props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
|
|
|
@ -4,6 +4,7 @@ import { Modal } from 'modal/modal';
|
|||
import { FormField } from 'component/common/form';
|
||||
|
||||
type Props = {
|
||||
claim: StreamClaim,
|
||||
claimIsMine: boolean,
|
||||
closeModal: () => void,
|
||||
deleteFile: (string, boolean, boolean) => void,
|
||||
|
@ -45,10 +46,11 @@ class ModalRemoveFile extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { claimIsMine, closeModal, deleteFile, fileInfo, title } = this.props;
|
||||
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}`;
|
||||
|
||||
const outpoint = fileInfo ? fileInfo.outpoint : '';
|
||||
return (
|
||||
<Modal
|
||||
isOpen
|
||||
|
|
|
@ -2,7 +2,7 @@ import * as ACTIONS from 'constants/action_types';
|
|||
// @if TARGET='app'
|
||||
import { shell } from 'electron';
|
||||
// @endif
|
||||
import { Lbry, batchActions, doAbandonClaim, selectMyClaimsOutpoints, selectFileInfosByOutpoint } from 'lbry-redux';
|
||||
import { Lbry, batchActions, doAbandonClaim, selectMyClaimsOutpoints } from 'lbry-redux';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { goBack } from 'connected-react-router';
|
||||
|
||||
|
@ -33,15 +33,9 @@ export function doDeleteFile(outpoint, deleteFromComputer, abandonClaim) {
|
|||
// If the file is for a claim we published then also abandon the claim
|
||||
const myClaimsOutpoints = selectMyClaimsOutpoints(state);
|
||||
if (abandonClaim && myClaimsOutpoints.indexOf(outpoint) !== -1) {
|
||||
const byOutpoint = selectFileInfosByOutpoint(state);
|
||||
const fileInfo = byOutpoint[outpoint];
|
||||
const [txid, nout] = outpoint.split(':');
|
||||
|
||||
if (fileInfo) {
|
||||
const txid = fileInfo.outpoint.slice(0, -2);
|
||||
const nout = Number(fileInfo.outpoint.slice(-1));
|
||||
|
||||
dispatch(doAbandonClaim(txid, nout));
|
||||
}
|
||||
dispatch(doAbandonClaim(txid, nout));
|
||||
}
|
||||
|
||||
dispatch({
|
||||
|
|
|
@ -11,6 +11,7 @@ import {
|
|||
selectPendingById,
|
||||
selectMyClaimsWithoutChannels,
|
||||
doError,
|
||||
isClaimNsfw,
|
||||
} from 'lbry-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import { selectosNotificationsEnabled } from 'redux/selectors/settings';
|
||||
|
@ -152,14 +153,14 @@ export const doPrepareEdit = (claim: StreamClaim, uri: string) => (dispatch: Dis
|
|||
contentIsFree: !fee.amount,
|
||||
author,
|
||||
description,
|
||||
fee,
|
||||
fee: { amount: fee.amount, currency: fee.currency },
|
||||
languages,
|
||||
thumbnail: thumbnail ? thumbnail.url : null,
|
||||
title,
|
||||
uri,
|
||||
uploadThumbnailStatus: thumbnail ? THUMBNAIL_STATUSES.MANUAL : undefined,
|
||||
licenseUrl,
|
||||
replace: true,
|
||||
nsfw: isClaimNsfw(claim),
|
||||
};
|
||||
|
||||
// Make sure custom liscence's are mapped properly
|
||||
|
@ -203,6 +204,7 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
|||
fee,
|
||||
uri,
|
||||
nsfw,
|
||||
claim,
|
||||
} = params;
|
||||
|
||||
// get the claim id from the channel name, we will use that instead
|
||||
|
@ -214,36 +216,58 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat
|
|||
channel_id?: string,
|
||||
bid: number,
|
||||
file_path?: string,
|
||||
fee?: { amount: string, currency: 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),
|
||||
title,
|
||||
license,
|
||||
license_url: licenseUrl,
|
||||
languages: [language],
|
||||
description,
|
||||
thumbnail_url: thumbnail,
|
||||
tags: [],
|
||||
tags: (claim && claim.value.tags) || [],
|
||||
locations: claim && claim.value.locations,
|
||||
};
|
||||
|
||||
// Temporary solution to keep the same publish flow with the new tags api
|
||||
// Eventually we will allow users to enter their own tags on publish
|
||||
// `nsfw` will probably be removed
|
||||
|
||||
if (licenseUrl) {
|
||||
publishPayload.license_url = licenseUrl;
|
||||
}
|
||||
|
||||
if (thumbnail) {
|
||||
publishPayload.thumbnail_url = thumbnail;
|
||||
}
|
||||
|
||||
if (claim && claim.value.release_time) {
|
||||
publishPayload.release_time = Number(claim.value.release_time);
|
||||
}
|
||||
|
||||
if (nsfw) {
|
||||
publishPayload.tags.push('mature');
|
||||
if (!publishPayload.tags.includes('mature')) {
|
||||
publishPayload.tags.push('mature');
|
||||
}
|
||||
} else {
|
||||
const indexToRemove = publishPayload.tags.indexOf('mature');
|
||||
if (indexToRemove > -1) {
|
||||
publishPayload.tags.splice(indexToRemove, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (channelId) {
|
||||
publishPayload.channel_id = channelId;
|
||||
}
|
||||
|
||||
if (fee) {
|
||||
publishPayload.fee = {
|
||||
currency: fee.currency,
|
||||
amount: creditsToString(fee.amount),
|
||||
};
|
||||
if (!contentIsFree && fee && (fee.currency && Number(fee.amount) > 0)) {
|
||||
publishPayload.fee_currency = fee.currency;
|
||||
publishPayload.fee_amount = creditsToString(fee.amount);
|
||||
}
|
||||
|
||||
// Only pass file on new uploads, not metadata only edits.
|
||||
|
|
|
@ -9,7 +9,7 @@ type PublishState = {
|
|||
editingURI: ?string,
|
||||
filePath: ?string,
|
||||
contentIsFree: boolean,
|
||||
price: {
|
||||
fee: {
|
||||
amount: number,
|
||||
currency: string,
|
||||
},
|
||||
|
@ -33,7 +33,7 @@ const defaultState: PublishState = {
|
|||
editingURI: undefined,
|
||||
filePath: undefined,
|
||||
contentIsFree: true,
|
||||
price: {
|
||||
fee: {
|
||||
amount: 1,
|
||||
currency: 'LBC',
|
||||
},
|
||||
|
|
30
yarn.lock
30
yarn.lock
|
@ -6498,9 +6498,9 @@ lazy-val@^1.0.3, lazy-val@^1.0.4:
|
|||
yargs "^13.2.2"
|
||||
zstd-codec "^0.1.1"
|
||||
|
||||
lbry-redux@lbryio/lbry-redux#32916b04e4888c06a9bb2b07c57ce6821a4acf1a:
|
||||
lbry-redux@lbryio/lbry-redux#423123f1c19e61cead67c745d0892a2e4481cb6a:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/32916b04e4888c06a9bb2b07c57ce6821a4acf1a"
|
||||
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/423123f1c19e61cead67c745d0892a2e4481cb6a"
|
||||
dependencies:
|
||||
proxy-polyfill "0.1.6"
|
||||
reselect "^3.0.0"
|
||||
|
@ -6696,7 +6696,7 @@ lodash-es@^4.17.11, lodash-es@^4.17.4, lodash-es@^4.2.1:
|
|||
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0"
|
||||
integrity sha512-DHb1ub+rMjjrxqlB3H56/6MXtm1lSksDp2rA2cNWjG8mlDUYFhUj3Di2Zn5IwSU87xLv8tNIQ7sSwE/YOX/D/Q==
|
||||
|
||||
lodash.assign@^4.0.3, lodash.assign@^4.0.6, lodash.assign@^4.2.0:
|
||||
lodash.assign@^4.0.3, lodash.assign@^4.0.6:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
|
||||
integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=
|
||||
|
@ -6706,11 +6706,6 @@ lodash.camelcase@^4.3.0:
|
|||
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
|
||||
integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY=
|
||||
|
||||
lodash.clonedeep@^4.3.2:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
|
||||
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
|
||||
|
||||
lodash.findkey@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.findkey/-/lodash.findkey-4.6.0.tgz#83058e903b51cbb759d09ccf546dea3ea39c4718"
|
||||
|
@ -6746,11 +6741,6 @@ lodash.memoize@^4.1.2:
|
|||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
|
||||
|
||||
lodash.mergewith@^4.6.0:
|
||||
version "4.6.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927"
|
||||
integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==
|
||||
|
||||
lodash.pickby@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
|
||||
|
@ -7375,7 +7365,7 @@ nan@2.12.1:
|
|||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552"
|
||||
integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==
|
||||
|
||||
nan@^2.10.0, nan@^2.9.2:
|
||||
nan@^2.13.2, nan@^2.9.2:
|
||||
version "2.13.2"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7"
|
||||
integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==
|
||||
|
@ -7556,9 +7546,9 @@ node-releases@^1.1.13:
|
|||
semver "^5.3.0"
|
||||
|
||||
node-sass@^4.11.0:
|
||||
version "4.11.0"
|
||||
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.11.0.tgz#183faec398e9cbe93ba43362e2768ca988a6369a"
|
||||
integrity sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==
|
||||
version "4.12.0"
|
||||
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.12.0.tgz#0914f531932380114a30cc5fa4fa63233a25f017"
|
||||
integrity sha512-A1Iv4oN+Iel6EPv77/HddXErL2a+gZ4uBeZUy+a8O35CFYTXhgA8MgLCWBtwpGZdCvTvQ9d+bQxX/QC36GDPpQ==
|
||||
dependencies:
|
||||
async-foreach "^0.1.3"
|
||||
chalk "^1.1.1"
|
||||
|
@ -7567,12 +7557,10 @@ node-sass@^4.11.0:
|
|||
get-stdin "^4.0.1"
|
||||
glob "^7.0.3"
|
||||
in-publish "^2.0.0"
|
||||
lodash.assign "^4.2.0"
|
||||
lodash.clonedeep "^4.3.2"
|
||||
lodash.mergewith "^4.6.0"
|
||||
lodash "^4.17.11"
|
||||
meow "^3.7.0"
|
||||
mkdirp "^0.5.1"
|
||||
nan "^2.10.0"
|
||||
nan "^2.13.2"
|
||||
node-gyp "^3.8.0"
|
||||
npmlog "^4.0.0"
|
||||
request "^2.88.0"
|
||||
|
|
Loading…
Reference in a new issue