Skip to content

Commit

Permalink
Introduce feature flag for new browsing experience
Browse files Browse the repository at this point in the history
  • Loading branch information
ziad-saab committed Jan 7, 2025
1 parent edb523a commit 33191a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .js.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ export MM_MULTICHAIN_V1_ENABLED=""

# Permissions Settings feature flag specific to UI changes
export MM_PERMISSIONS_SETTINGS_V1_ENABLED=""

# Temporary feature flag to enable new browsing/explore experience. Set to "true" to enable.
export MM_NEW_BROWSING_EXPERIENCE_ENABLED=""
1 change: 1 addition & 0 deletions app/core/AppConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,5 @@ export default {
BASE_URL: 'https://client-config.api.cx.metamask.io',
VERSION: 'v1',
},
MM_NEW_BROWSING_EXPERIENCE_ENABLED: process.env.MM_NEW_BROWSING_EXPERIENCE_ENABLED === 'true',
} as const;
3 changes: 3 additions & 0 deletions app/util/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Linking } from 'react-native';
import isUrl from 'is-url';
import Url from 'url-parse';
import { regex, hasProtocol } from '../../util/regex';
import AppConstants from '../../core/AppConstants';

/**
* Returns URL prefixed with protocol
Expand Down Expand Up @@ -155,3 +156,5 @@ export const allowLinkOpen = (url: string) =>
.catch((e) => {
console.warn(`Error opening URL: ${e}`);
});

export const isNewBrowsingExperienceEnabled = () => AppConstants.MM_NEW_BROWSING_EXPERIENCE_ENABLED;

0 comments on commit 33191a6

Please sign in to comment.