From ef8e87c48c8bb5fadd33e2b0ae227bfdc188ce8f Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 12 Mar 2018 13:48:12 -0700 Subject: [PATCH 1/2] added config value to disable publishing --- config/speechConfig.js.example | 7 ++++--- react/containers/PublishTool/index.js | 6 ++++-- react/containers/PublishTool/view.jsx | 11 +++++++++-- react/reducers/publish.js | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/config/speechConfig.js.example b/config/speechConfig.js.example index fe0d5e76..e1d5538f 100644 --- a/config/speechConfig.js.example +++ b/config/speechConfig.js.example @@ -3,12 +3,12 @@ module.exports = { googleId: null, // google id for analytics tracking; leave `null` if not applicable }, sql: { - database: null, // name of mysql database + database: 'lbry', username: null, // username for mysql password: null, // password for mysql }, logging: { - logLevel : null, // options: silly, debug, verbose, info + logLevel : 'debug', // options: silly, debug, verbose, info slackWebHook : null, // enter a webhook if you wish to push logs to slack; otherwise leave as `null` slackErrorChannel: null, // enter a slack channel (#example) for errors to be sent to; otherwise leave null slackInfoChannel : null, // enter a slack channel (#info) for info level logs to be sent to otherwise leave null @@ -26,8 +26,9 @@ module.exports = { description: 'Open-source, decentralized image and video sharing.', }, publish: { - primaryClaimAddress : null, // choose any address from your lbry wallet additionalClaimAddresses: [], // // optional: add previously used claim addresses + disabled : false, + primaryClaimAddress : null, // choose any address from your lbry wallet thumbnailChannel : '@channelName', // create a channel to use for thumbnail images thumbnailChannelId : 'xyz123...', // the channel_id (claim id) for the channel above }, diff --git a/react/containers/PublishTool/index.js b/react/containers/PublishTool/index.js index c997c832..b0595839 100644 --- a/react/containers/PublishTool/index.js +++ b/react/containers/PublishTool/index.js @@ -3,8 +3,10 @@ import View from './view'; const mapStateToProps = ({ publish }) => { return { - file : publish.file, - status: publish.status.status, + disabled : publish.disabled, + disabledMessage: publish.disabledMessage, + file : publish.file, + status : publish.status.status, }; }; diff --git a/react/containers/PublishTool/view.jsx b/react/containers/PublishTool/view.jsx index 2207e3b9..42167ad2 100644 --- a/react/containers/PublishTool/view.jsx +++ b/react/containers/PublishTool/view.jsx @@ -5,6 +5,14 @@ import PublishStatus from 'containers/PublishStatus'; class PublishTool extends React.Component { render () { + if (this.props.disabled) { + return ( +
+

Publishing is temporarily disabled.

+

Please check back soon or join our discord channel for updates.

+
+ ); + } if (this.props.file) { if (this.props.status) { return ( @@ -13,9 +21,8 @@ class PublishTool extends React.Component { } else { return ; } - } else { - return ; } + return ; } }; diff --git a/react/reducers/publish.js b/react/reducers/publish.js index 3343bded..b1bffad5 100644 --- a/react/reducers/publish.js +++ b/react/reducers/publish.js @@ -3,6 +3,7 @@ import { LOGIN } from 'constants/publish_channel_select_states'; const { publish } = require('../../config/speechConfig.js'); const initialState = { + disabled : publish.disabled, publishInChannel : false, selectedChannel : LOGIN, showMetadataInputs: false, -- 2.45.2 From 6bb1ca606b89b44c020246c79c8a071b041f1db4 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Mon, 12 Mar 2018 13:57:55 -0700 Subject: [PATCH 2/2] removed message param from selector --- react/containers/PublishTool/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/react/containers/PublishTool/index.js b/react/containers/PublishTool/index.js index b0595839..9258d560 100644 --- a/react/containers/PublishTool/index.js +++ b/react/containers/PublishTool/index.js @@ -3,10 +3,9 @@ import View from './view'; const mapStateToProps = ({ publish }) => { return { - disabled : publish.disabled, - disabledMessage: publish.disabledMessage, - file : publish.file, - status : publish.status.status, + disabled: publish.disabled, + file : publish.file, + status : publish.status.status, }; }; -- 2.45.2