Skip to content

Commit

Permalink
Prevent old MM home from breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
Cal-L committed Oct 1, 2024
1 parent e7a1996 commit 0ac56ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ import handleWebViewFocus from '../../../util/browser/webViewFocus';
import { isTest } from '../../../util/test/utils.js';
import { EXTERNAL_LINK_TYPE } from '../../../constants/browser';

const { HOMEPAGE_URL, NOTIFICATION_NAMES } = AppConstants;
const { HOMEPAGE_URL, NOTIFICATION_NAMES, OLD_HOMEPAGE_URL_HOST } =
AppConstants;
const HOMEPAGE_HOST = new URL(HOMEPAGE_URL)?.hostname;
const MM_MIXPANEL_TOKEN = process.env.MM_MIXPANEL_TOKEN;

Expand Down Expand Up @@ -363,7 +364,9 @@ export const BrowserTab = (props) => {
const currentPage = checkUrl || url.current;
const prefixedUrl = prefixUrlWithProtocol(currentPage);
const { host: currentHost } = getUrlObj(prefixedUrl);
return currentHost === HOMEPAGE_HOST;
return (
currentHost === HOMEPAGE_HOST || currentHost === OLD_HOMEPAGE_URL_HOST
);
}, []);

const notifyAllConnections = useCallback((payload, restricted = true) => {
Expand Down
1 change: 1 addition & 0 deletions app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default {
HOMEPAGE_URL:
process.env.MM_HOMEPAGE ||
'https://portfolio.metamask.io/explore?MetaMaskEntry=mobile/',
OLD_HOMEPAGE_URL_HOST: 'home.metamask.io',
SHORT_HOMEPAGE_URL: 'MetaMask.io',
ZERO_ADDRESS: '0x0000000000000000000000000000000000000000',
USER_AGENT: Device.isAndroid()
Expand Down

0 comments on commit 0ac56ee

Please sign in to comment.