diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 6858d89ee..fc0bbd934 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -15,6 +15,7 @@ import { withRouter } from 'react-router'; import usePrevious from 'effects/use-previous'; import Nag from 'component/common/nag'; import { rewards as REWARDS } from 'lbryinc'; +import usePersistedState from 'effects/use-persisted-state'; // @if TARGET='web' import OpenInAppLink from 'component/openInAppLink'; import YoutubeWelcome from 'component/youtubeWelcome'; @@ -89,6 +90,9 @@ function App(props: Props) { const previousUserId = usePrevious(userId); const previousHasVerifiedEmail = usePrevious(hasVerifiedEmail); const previousRewardApproved = usePrevious(isRewardApproved); + // @if TARGET='web' + const [showAnalyticsNag, setShowAnalyticsNag] = usePersistedState('analytics-nag', true); + // @endif const { pathname, hash, search } = props.location; const showUpgradeButton = autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable); // referral claiming @@ -104,6 +108,12 @@ function App(props: Props) { uri = newpath + hash; } catch (e) {} + // @if TARGET='web' + function handleAnalyticsDismiss() { + setShowAnalyticsNag(false); + } + // @endif + useEffect(() => { if (!uploadCount) return; const handleBeforeUnload = event => { @@ -234,6 +244,16 @@ function App(props: Props) { )} {/* @endif */} + {/* @if TARGET='web' */} + {showAnalyticsNag && ( + + )} + {/* @endif */} {isEnhancedLayout && } );