diff --git a/landing/landing.react.js b/landing/landing.react.js
index 5f8a65ca1..2e0c3ba5c 100644
--- a/landing/landing.react.js
+++ b/landing/landing.react.js
@@ -1,58 +1,61 @@
// @flow
import * as React from 'react';
-import { useRouteMatch } from 'react-router-dom';
+import { useLocation, useRouteMatch } from 'react-router-dom';
import AppLanding from './app-landing.react';
import Footer from './footer.react';
import Header from './header.react';
import Keyservers from './keyservers.react';
import Privacy from './privacy.react';
import Support from './support.react';
import Terms from './terms.react';
-import useScrollToTop from './useScrollToTop.react';
export type LandingPageName =
| 'app'
| 'keyservers'
| 'privacy'
| 'terms'
| 'support';
type ActivePage = { name: LandingPageName, node: React.Node };
function Landing(): React.Node {
- useScrollToTop();
+ const { pathname } = useLocation();
+ React.useEffect(() => {
+ window?.scrollTo(0, 0);
+ }, [pathname]);
+
const onPrivacy = useRouteMatch({ path: '/privacy' });
const onTerms = useRouteMatch({ path: '/terms' });
const onSupport = useRouteMatch({ path: '/support' });
const onKeyservers = useRouteMatch({ path: '/keyservers' });
const isLegalPage: boolean = React.useMemo(
() => !!(onPrivacy || onTerms || onSupport),
[onPrivacy, onSupport, onTerms],
);
const activePage: ActivePage = React.useMemo(() => {
if (onPrivacy) {
return { name: 'privacy', node: