Fixed formatting issues
This commit is contained in:
parent
74bab48749
commit
f2f316968b
4 changed files with 21 additions and 14 deletions
|
@ -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(() => {});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
@ -23,9 +30,8 @@ export default ({ channelName, uri, subscriptions, doChannelSubscribe, doChannel
|
|||
subscriptionHandler({
|
||||
channelName,
|
||||
uri,
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
) : null;
|
||||
|
|
|
@ -10,10 +10,12 @@ const ModalFirstSubscription = props => {
|
|||
<section>
|
||||
<h3 className="modal__header">{__('Your first subscription!')}</h3>
|
||||
<p>
|
||||
{__('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.'
|
||||
)}
|
||||
</p>
|
||||
<div className="modal__buttons">
|
||||
<Link button="primary" onClick={closeModal} label={__("Got it")} />
|
||||
<Link button="primary" onClick={closeModal} label={__('Got it')} />
|
||||
</div>
|
||||
</section>
|
||||
</Modal>
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue