This commit is contained in:
Sean Yesmunt 2019-12-19 12:22:38 -05:00
parent 5fc6dd9b3d
commit 864d1546f8
4 changed files with 10 additions and 36 deletions

View file

@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { selectPublishFormValues, doUpdatePublishForm, doToast } from 'lbry-redux';
import { selectPublishFormValues, doUpdatePublishForm } from 'lbry-redux';
import PublishPage from './view';
const select = state => ({
@ -8,7 +8,6 @@ const select = state => ({
const perform = dispatch => ({
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
showToast: message => dispatch(doToast({ isError: true, message })),
});
export default connect(

View file

@ -2,7 +2,6 @@
import * as React from 'react';
import { FormField } from 'component/common/form';
import { CC_LICENSES, LEGACY_CC_LICENSES, COPYRIGHT, OTHER, PUBLIC_DOMAIN, NONE } from 'constants/licenses';
import analytics from 'analytics';
type Props = {
licenseType: ?string,
@ -11,7 +10,6 @@ type Props = {
handleLicenseChange: (string, string) => void,
handleLicenseDescriptionChange: (SyntheticInputEvent<*>) => void,
handleLicenseUrlChange: (SyntheticInputEvent<*>) => void,
showToast: string => void,
};
class LicenseType extends React.PureComponent<Props> {
@ -22,26 +20,14 @@ class LicenseType extends React.PureComponent<Props> {
}
handleLicenseOnChange(event: SyntheticInputEvent<*>) {
const { handleLicenseChange, showToast } = this.props;
const { handleLicenseChange } = this.props;
// $FlowFixMe
const { options, selectedIndex } = event.target;
const selectedOption = options[selectedIndex];
const licenseType = selectedOption.value;
const licenseUrl = selectedOption.getAttribute('data-url');
if (options !== null) {
const selectedOption = options[selectedIndex];
const licenseType = selectedOption.value;
const licenseUrl = selectedOption.getAttribute('data-url');
handleLicenseChange(licenseType, licenseUrl);
} else {
// There were users where this options were null for some reason
// This will at least make it so the app doesn't crash
// Hopefully this helps figure it out
analytics.error('Error changing the publish license\n' + JSON.stringify(this.props));
showToast(
__('There was an error updating the license type. If it continues to happen send an email to help@lbry.com.')
);
}
handleLicenseChange(licenseType, licenseUrl);
}
render() {

View file

@ -15,11 +15,10 @@ type Props = {
licenseUrl: ?string,
disabled: boolean,
updatePublishForm: ({}) => void,
showToast: string => void,
};
function PublishAdvanced(props: Props) {
const { language, name, licenseType, otherLicenseDescription, licenseUrl, updatePublishForm, showToast } = props;
const { language, name, licenseType, otherLicenseDescription, licenseUrl, updatePublishForm } = props;
const [hideSection, setHideSection] = usePersistedState('publish-advanced-options', true);
function toggleHideSection() {
@ -67,7 +66,6 @@ function PublishAdvanced(props: Props) {
</FormField>
<LicenseType
showToast={showToast}
licenseType={licenseType}
otherLicenseDescription={otherLicenseDescription}
licenseUrl={licenseUrl}

View file

@ -5,13 +5,8 @@ import { FormField } from 'component/common/form';
import Button from 'component/button';
import I18nMessage from 'component/i18nMessage';
import * as ICONS from 'constants/icons';
import ServerInputRow from './internal/inputRow';
type DaemonStatus = {
wallet: any,
};
type StatusOfServer = {
host: string,
port: string,
@ -22,11 +17,6 @@ type StatusOfServer = {
type ServerTuple = [string, string]; // ['host', 'port']
type ServerStatus = Array<StatusOfServer>;
type ServerConfig = Array<ServerTuple>;
type DaemonSettings = {
lbryum_servers: ServerConfig,
};
type DaemonStatus = {
wallet: any,
};
@ -152,10 +142,11 @@ function SettingWalletServer(props: Props) {
<p className="help">
<I18nMessage
tokens={{
help_link: <Button button="link" href="http://lbry.com/faq/wallet-servers" label={__('Learn More')} />,
learn_more: <Button button="link" href="http://lbry.com/faq/wallet-servers" label={__('Learn More')} />,
}}
>
Wallet servers control what content is trending, ..., idk. %help_link%.
Wallet servers are used to relay data to and from the LBRY blockchain. They also determine what content
shows in trending or is blocked. %learn_more%.
</I18nMessage>
</p>