From f2f316968bc1a04994a60914c218453bb73e9ddd Mon Sep 17 00:00:00 2001 From: liamcardenas Date: Fri, 16 Mar 2018 11:26:44 -0700 Subject: [PATCH] Fixed formatting issues --- src/renderer/analytics.js | 9 ++++----- src/renderer/component/subscribeButton/view.jsx | 16 +++++++++++----- .../modal/modalFirstSubscription/view.jsx | 6 ++++-- src/renderer/redux/actions/subscriptions.js | 4 ++-- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/renderer/analytics.js b/src/renderer/analytics.js index f785b3906..2a03b7428 100644 --- a/src/renderer/analytics.js +++ b/src/renderer/analytics.js @@ -4,7 +4,6 @@ import Lbryio from 'lbryio'; import isDev from 'electron-is-dev'; import type { Subscription } from 'redux/reducers/subscriptions'; - if (isDev) { mixpanel.init('691723e855cabb9d27a7a79002216967'); } else { @@ -16,8 +15,8 @@ type Analytics = { setUser: Object => void, toggle: (boolean, ?boolean) => void, apiLogView: (string, string, string) => void, - apiLogSubscribe: (Subscription) => void, - apiLogUnsubscribe: (Subscription) => void, + apiLogSubscribe: Subscription => void, + apiLogUnsubscribe: Subscription => void, }; let analyticsEnabled: boolean = false; @@ -60,14 +59,14 @@ const analytics: Analytics = { apiLogSubscribe: (subscription: Subscription): void => { if (analyticsEnabled) { Lbryio.call('subscription', 'new', { - subscription + subscription, }).catch(() => {}); } }, apiLogUnsubscribe: (subscription: Subscription): void => { if (analyticsEnabled) { Lbryio.call('subscription', 'delete', { - subscription + subscription, }).catch(() => {}); } }, diff --git a/src/renderer/component/subscribeButton/view.jsx b/src/renderer/component/subscribeButton/view.jsx index 819055eed..bb0d0c146 100644 --- a/src/renderer/component/subscribeButton/view.jsx +++ b/src/renderer/component/subscribeButton/view.jsx @@ -2,7 +2,14 @@ import React from 'react'; import Link from 'component/link'; import * as modals from 'constants/modal_types'; -export default ({ channelName, uri, subscriptions, doChannelSubscribe, doChannelUnsubscribe, doOpenModal }) => { +export default ({ + channelName, + uri, + subscriptions, + doChannelSubscribe, + doChannelUnsubscribe, + doOpenModal, +}) => { const isSubscribed = subscriptions.map(subscription => subscription.channelName).indexOf(channelName) !== -1; @@ -17,15 +24,14 @@ export default ({ channelName, uri, subscriptions, doChannelSubscribe, doChannel button={isSubscribed ? 'alt' : 'primary'} label={subscriptionLabel} onClick={() => { - if(!subscriptions.length) { + if (!subscriptions.length) { doOpenModal(modals.FIRST_SUBSCRIPTION); } subscriptionHandler({ channelName, uri, - }) - } - } + }); + }} /> ) : null; diff --git a/src/renderer/modal/modalFirstSubscription/view.jsx b/src/renderer/modal/modalFirstSubscription/view.jsx index d2e17c38c..f489e6277 100644 --- a/src/renderer/modal/modalFirstSubscription/view.jsx +++ b/src/renderer/modal/modalFirstSubscription/view.jsx @@ -10,10 +10,12 @@ const ModalFirstSubscription = props => {

{__('Your first subscription!')}

- {__('When you subscribe to a channel, you will automatically download, and be notified of, all of its new content.')} + {__( + 'When you subscribe to a channel, you will automatically download, and be notified of, all of its new content.' + )}

- +
diff --git a/src/renderer/redux/actions/subscriptions.js b/src/renderer/redux/actions/subscriptions.js index 02d2b5ea6..58269ab40 100644 --- a/src/renderer/redux/actions/subscriptions.js +++ b/src/renderer/redux/actions/subscriptions.js @@ -19,7 +19,7 @@ export const doChannelSubscribe = (subscription: Subscription) => (dispatch: Dis analytics.apiLogSubscribe(subscription); dispatch(doCheckSubscription(subscription, true)); -} +}; export const doChannelUnsubscribe = (subscription: Subscription) => (dispatch: Dispatch) => { dispatch({ @@ -28,7 +28,7 @@ export const doChannelUnsubscribe = (subscription: Subscription) => (dispatch: D }); analytics.apiLogUnsubscribe(subscription); -} +}; export const doCheckSubscriptions = () => ( dispatch: Dispatch,