diff --git a/ui/analytics.js b/ui/analytics.js index 7152300df..e9089d789 100644 --- a/ui/analytics.js +++ b/ui/analytics.js @@ -3,22 +3,10 @@ import { Lbryio } from 'lbryinc'; import * as Sentry from '@sentry/browser'; import MatomoTracker from '@datapunt/matomo-tracker-js'; import { history } from './store'; -import { SDK_API_PATH } from './index'; -// @if TARGET='app' import Native from 'native'; import ElectronCookies from '@meetfranz/electron-cookies'; import { generateInitialUrl } from 'util/url'; -// @endif import { MATOMO_ID, MATOMO_URL } from 'config'; -// import getConnectionSpeed from 'util/detect-user-bandwidth'; - -// let userDownloadBandwidthInBitsPerSecond; -// async function getUserBandwidth() { -// userDownloadBandwidthInBitsPerSecond = await getConnectionSpeed(); -// } - -// get user bandwidth every minute, starting after an initial one minute wait -// setInterval(getUserBandwidth, 1000 * 60); const isProduction = process.env.NODE_ENV === 'production'; const devInternalApis = process.env.LBRY_API_URL && process.env.LBRY_API_URL.includes('dev'); @@ -27,7 +15,7 @@ export const SHARE_INTERNAL = 'shareInternal'; const SHARE_THIRD_PARTY = 'shareThirdParty'; const WATCHMAN_BACKEND_ENDPOINT = 'https://watchman.na-backend.odysee.com/reports/playback'; -const SEND_DATA_TO_WATCHMAN_INTERVAL = 10; // in seconds +// const SEND_DATA_TO_WATCHMAN_INTERVAL = 10; // in seconds if (isProduction) { ElectronCookies.enable({ @@ -80,7 +68,7 @@ type LogPublishParams = { channel_claim_id?: string, }; -let internalAnalyticsEnabled: boolean = IS_WEB || false; +let internalAnalyticsEnabled: boolean = false; if (window.localStorage.getItem(SHARE_INTERNAL) === 'true') internalAnalyticsEnabled = true; /** @@ -164,11 +152,6 @@ function startWatchmanIntervalIfNotRunning() { if (!watchmanInterval) { // instantiate the first time to calculate duration from lastSentTime = new Date(); - - // only set an interval if analytics are enabled and is prod - if (isProduction && IS_WEB) { - watchmanInterval = setInterval(sendAndResetWatchmanData, 1000 * SEND_DATA_TO_WATCHMAN_INTERVAL); - } } } @@ -240,7 +223,7 @@ const analytics: Analytics = { videoPlayer = passedPlayer; bitrateAsBitsPerSecond = videoBitrate; - sendPromMetric('time_to_start', duration); + // sendPromMetric('time_to_start', duration); sendMatomoEvent('Media', 'TimeToStart', claimId, duration); }, error: (message) => { @@ -313,7 +296,7 @@ const analytics: Analytics = { claim_id: claimId, }; - if (timeToStart && !IS_WEB) { + if (timeToStart) { params.time_to_start = timeToStart; } @@ -405,14 +388,15 @@ function sendMatomoEvent(category, action, name, value) { } } -function sendPromMetric(name: string, value?: number) { - if (IS_WEB) { - let url = new URL(SDK_API_PATH + '/metric/ui'); - const params = { name: name, value: value ? value.toString() : '' }; - url.search = new URLSearchParams(params).toString(); - return fetch(url, { method: 'post' }); - } -} +// Prometheus +// function sendPromMetric(name: string, value?: number) { +// if (IS_WEB) { +// let url = new URL(SDK_API_PATH + '/metric/ui'); +// const params = { name: name, value: value ? value.toString() : '' }; +// url.search = new URLSearchParams(params).toString(); +// return fetch(url, { method: 'post' }); +// } +// } const MatomoInstance = new MatomoTracker({ urlBase: MATOMO_URL, diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 9ea9a5c4d..aeb10d572 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -314,7 +314,6 @@ function App(props: Props) { if (!hasSignedIn && hasVerifiedEmail) { signIn(); setHasSignedIn(true); - if (IS_WEB) setReadyForSync(true); } }, [hasVerifiedEmail, signIn, hasSignedIn]); @@ -339,7 +338,7 @@ function App(props: Props) { [`${MAIN_WRAPPER_CLASS}--scrollbar`]: useCustomScrollbar, })} ref={appRef} - onContextMenu={IS_WEB ? undefined : (e) => openContextMenu(e)} + onContextMenu={(e) => openContextMenu(e)} > diff --git a/ui/component/claimCollectionAddButton/view.jsx b/ui/component/claimCollectionAddButton/view.jsx index c3d01dd9f..01847da85 100644 --- a/ui/component/claimCollectionAddButton/view.jsx +++ b/ui/component/claimCollectionAddButton/view.jsx @@ -29,7 +29,6 @@ export default function CollectionAddButton(props: Props) { icon={fileAction ? (!isSaved ? ICONS.ADD : ICONS.STACK) : ICONS.LIBRARY} iconSize={fileAction ? 22 : undefined} label={uri ? (!isSaved ? __('Save') : __('Saved')) : __('New List')} - requiresAuth={IS_WEB} title={__('Add this claim to a list')} onClick={(e) => { e.preventDefault(); diff --git a/ui/component/claimMenuList/index.js b/ui/component/claimMenuList/index.js index 847270381..6996729f5 100644 --- a/ui/component/claimMenuList/index.js +++ b/ui/component/claimMenuList/index.js @@ -27,7 +27,6 @@ import { import { doToast } from 'redux/actions/notifications'; import { doChannelSubscribe, doChannelUnsubscribe } from 'redux/actions/subscriptions'; import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions'; -import { selectUserVerifiedEmail } from 'redux/selectors/user'; import { selectListShuffle } from 'redux/selectors/content'; import { doToggleLoopList, doToggleShuffleList } from 'redux/actions/content'; import ClaimPreview from './view'; @@ -69,7 +68,6 @@ const select = (state, props) => { claimInCollection: makeSelectCollectionForIdHasClaimUrl(collectionId, contentPermanentUri)(state), isMyCollection: makeSelectCollectionIsMine(collectionId)(state), editedCollection: makeSelectEditedCollectionForId(collectionId)(state), - isAuthenticated: Boolean(selectUserVerifiedEmail(state)), resolvedList: makeSelectUrlsForCollectionId(collectionId)(state), playNextUri, }; diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index f91fc1ac6..f4b458841 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -8,13 +8,7 @@ import React from 'react'; import classnames from 'classnames'; import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button'; import Icon from 'component/common/icon'; -import { - generateShareUrl, - generateRssUrl, - generateLbryContentUrl, - formatLbryUrlForWeb, - generateListSearchUrlParams, -} from 'util/url'; +import { generateShareUrl, generateLbryContentUrl, formatLbryUrlForWeb, generateListSearchUrlParams } from 'util/url'; import { useHistory } from 'react-router'; import { buildURI, parseURI } from 'util/lbryURI'; @@ -62,7 +56,6 @@ type Props = { doChannelUnsubscribe: (SubscriptionArgs) => void, isChannelPage: boolean, editedCollection: Collection, - isAuthenticated: boolean, playNextUri: string, resolvedList: boolean, fetchCollectionItems: (string) => void, @@ -103,7 +96,6 @@ function ClaimMenuList(props: Props) { doChannelUnsubscribe, isChannelPage = false, editedCollection, - isAuthenticated, playNextUri, resolvedList, fetchCollectionItems, @@ -150,7 +142,6 @@ function ClaimMenuList(props: Props) { const lbryUrl: string = generateLbryContentUrl(claim.canonical_url, claim.permanent_url); const shareUrl: string = generateShareUrl(SHARE_DOMAIN, lbryUrl); - const rssUrl: string = isChannel ? generateRssUrl(SHARE_DOMAIN, claim) : ''; const isCollectionClaim = claim && claim.value_type === 'collection'; // $FlowFixMe const isPlayable = @@ -252,10 +243,6 @@ function ClaimMenuList(props: Props) { }); } - function handleCopyRssLink() { - copyToClipboard(rssUrl, 'RSS URL copied.', 'Failed to copy RSS URL.'); - } - function handleCopyLink() { copyToClipboard(shareUrl, 'Link copied.', 'Failed to copy link.'); } @@ -281,7 +268,6 @@ function ClaimMenuList(props: Props) { } }; - const shouldShow = !IS_WEB || (IS_WEB && isAuthenticated); return ( ) : ( - shouldShow && isPlayable && ( <> {/* WATCH LATER */} @@ -381,105 +366,89 @@ function ClaimMenuList(props: Props) { ) )} - - {shouldShow && ( + {!isChannelPage && ( <> - {!isChannelPage && ( - <> - -
- - {__('Support --[button to support a claim]--')} -
-
- - )} + +
+ + {__('Support --[button to support a claim]--')} +
+
+ + )} - {!incognitoClaim && !claimIsMine && !isChannelPage && ( - <> -
- -
- - {subscriptionLabel} -
-
- - )} + {!incognitoClaim && !claimIsMine && !isChannelPage && ( + <> +
+ +
+ + {subscriptionLabel} +
+
+ + )} - {!isMyCollection && ( - <> - {(!claimIsMine || channelIsBlocked) && contentChannelUri ? ( - !incognitoClaim && ( - <> -
- -
- - {channelIsBlocked ? __('Unblock Channel') : __('Block Channel')} -
-
- - {isAdmin && ( - -
- - {channelIsAdminBlocked ? __('Global Unblock Channel') : __('Global Block Channel')} -
-
- )} - - -
- - {channelIsMuted ? __('Unmute Channel') : __('Mute Channel')} -
-
- - ) - ) : ( - <> - {!isChannelPage && !repostedClaim && ( - -
- - {__('Edit')} -
-
- )} - - )} - - {showDelete && ( - + {!isMyCollection && ( + <> + {(!claimIsMine || channelIsBlocked) && contentChannelUri ? ( + !incognitoClaim && ( + <> +
+
- - {__('Delete')} + + {channelIsBlocked ? __('Unblock Channel') : __('Block Channel')} +
+
+ + {isAdmin && ( + +
+ + {channelIsAdminBlocked ? __('Global Unblock Channel') : __('Global Block Channel')} +
+
+ )} + + +
+ + {channelIsMuted ? __('Unmute Channel') : __('Mute Channel')} +
+
+ + ) + ) : ( + <> + {!isChannelPage && !repostedClaim && ( + +
+ + {__('Edit')}
)} )} -
+ + {showDelete && ( + +
+ + {__('Delete')} +
+
+ )} )} - +
{__('Copy Link')}
- - {isChannelPage && IS_WEB && rssUrl && ( - -
- - {__('Copy RSS URL')} -
-
- )} - {!claimIsMine && !isMyCollection && (
diff --git a/ui/component/claimRepostButton/view.jsx b/ui/component/claimRepostButton/view.jsx index 57aa58850..ce7f57e5f 100644 --- a/ui/component/claimRepostButton/view.jsx +++ b/ui/component/claimRepostButton/view.jsx @@ -6,15 +6,15 @@ import React from 'react'; import Button from 'component/button'; type Props = { - uri: string, - claim: StreamClaim, - hasChannels: boolean, - doOpenModal: (string, {}) => void, - doToast: ({ message: string }) => void, + uri: string, + claim: StreamClaim, + hasChannels: boolean, + doOpenModal: (string, {}) => void, + doToast: ({ message: string }) => void, }; export default function ClaimRepostButton(props: Props) { - const { uri, claim, hasChannels, doOpenModal, doToast } = props; + const { uri, claim, hasChannels, doOpenModal, doToast } = props; const [contentUri, setContentUri] = React.useState(''); const [repostUri, setRepostUri] = React.useState(''); @@ -27,7 +27,6 @@ export default function ClaimRepostButton(props: Props) { claim.meta.reposted > 1 ? __(`%repost_total% Reposts`, { repost_total: claim.meta.reposted }) : __('Repost') } description={__('Repost')} - requiresAuth={IS_WEB} onClick={() => { if (!hasChannels) { doToast({ diff --git a/ui/component/claimSupportButton/view.jsx b/ui/component/claimSupportButton/view.jsx index b867b4b07..5d6e94c88 100644 --- a/ui/component/claimSupportButton/view.jsx +++ b/ui/component/claimSupportButton/view.jsx @@ -28,7 +28,6 @@ export default function ClaimSupportButton(props: Props) { icon={ICONS.LBC} iconSize={fileAction ? 22 : undefined} label={isRepost ? __('Support Repost') : __('Support --[button to support a claim]--')} - requiresAuth={IS_WEB} title={__('Support this claim')} onClick={() => doOpenModal(MODALS.SEND_TIP, { uri, isSupport: true })} /> diff --git a/ui/component/collectionEdit/view.jsx b/ui/component/collectionEdit/view.jsx index 108e21493..824a33878 100644 --- a/ui/component/collectionEdit/view.jsx +++ b/ui/component/collectionEdit/view.jsx @@ -1,5 +1,4 @@ // @flow -import { DOMAIN } from 'config'; import React from 'react'; import classnames from 'classnames'; import Button from 'component/button'; @@ -90,7 +89,7 @@ function CollectionForm(props: Props) { onDone, } = props; const activeChannelName = activeChannelClaim && activeChannelClaim.name; - let prefix = IS_WEB ? `${DOMAIN}/` : 'lbry://'; + let prefix = 'lbry://'; if (activeChannelName && !incognito) { prefix += `${activeChannelName}/`; } diff --git a/ui/component/comment/index.js b/ui/component/comment/index.js index b5c336522..81744b65f 100644 --- a/ui/component/comment/index.js +++ b/ui/component/comment/index.js @@ -9,7 +9,6 @@ import { doCommentUpdate, doCommentList } from 'redux/actions/comments'; import { makeSelectChannelIsMuted } from 'redux/selectors/blocked'; import { doToast } from 'redux/actions/notifications'; import { doSetPlayingUri } from 'redux/actions/content'; -import { selectUserVerifiedEmail } from 'redux/selectors/user'; import { selectLinkedCommentAncestors, selectOthersReactsForComment, @@ -28,7 +27,7 @@ const select = (state, props) => { claim: makeSelectClaimForUri(props.uri)(state), thumbnail: props.authorUri && makeSelectThumbnailForUri(props.authorUri)(state), channelIsBlocked: props.authorUri && makeSelectChannelIsMuted(props.authorUri)(state), - commentingEnabled: IS_WEB ? Boolean(selectUserVerifiedEmail(state)) : true, + commentingEnabled: true, othersReacts: selectOthersReactsForComment(state, reactionKey), activeChannelClaim, myChannels: selectMyChannelClaims(state), diff --git a/ui/component/comment/view.jsx b/ui/component/comment/view.jsx index 06afcf1f2..85c7f980d 100644 --- a/ui/component/comment/view.jsx +++ b/ui/component/comment/view.jsx @@ -314,13 +314,7 @@ function Comment(props: Props) { textAreaMaxLength={FF_MAX_CHARS_IN_COMMENT} />
-
@@ -354,7 +348,6 @@ function Comment(props: Props) {
{threadDepth !== 0 && (
); @@ -553,7 +553,6 @@ export function CommentCreate(props: Props) { icon={activeTab === TAB_LBC ? ICONS.LBC : ICONS.FINANCE} label={__('Review')} onClick={() => setIsReviewingSupportComment(true)} - requiresAuth={IS_WEB} />