mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
remove recovery phrase reminder
This commit is contained in:
parent
ac6f81d8da
commit
8ebc9fc4f8
@ -144,26 +144,6 @@ export default class AppStateController extends EventEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Record that the user has been shown the recovery phrase reminder.
|
|
||||||
*/
|
|
||||||
setRecoveryPhraseReminderHasBeenShown() {
|
|
||||||
this.store.updateState({
|
|
||||||
recoveryPhraseReminderHasBeenShown: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Record the timestamp of the last time the user has seen the recovery phrase reminder
|
|
||||||
*
|
|
||||||
* @param {number} lastShown - timestamp when user was last shown the reminder.
|
|
||||||
*/
|
|
||||||
setRecoveryPhraseReminderLastShown(lastShown) {
|
|
||||||
this.store.updateState({
|
|
||||||
recoveryPhraseReminderLastShown: lastShown,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record the timestamp of the last time the user has seen the outdated browser warning
|
* Record the timestamp of the last time the user has seen the outdated browser warning
|
||||||
*
|
*
|
||||||
|
@ -1983,14 +1983,6 @@ export default class MetamaskController extends EventEmitter {
|
|||||||
appStateController.setConnectedStatusPopoverHasBeenShown.bind(
|
appStateController.setConnectedStatusPopoverHasBeenShown.bind(
|
||||||
appStateController,
|
appStateController,
|
||||||
),
|
),
|
||||||
setRecoveryPhraseReminderHasBeenShown:
|
|
||||||
appStateController.setRecoveryPhraseReminderHasBeenShown.bind(
|
|
||||||
appStateController,
|
|
||||||
),
|
|
||||||
setRecoveryPhraseReminderLastShown:
|
|
||||||
appStateController.setRecoveryPhraseReminderLastShown.bind(
|
|
||||||
appStateController,
|
|
||||||
),
|
|
||||||
setOutdatedBrowserWarningLastShown:
|
setOutdatedBrowserWarningLastShown:
|
||||||
appStateController.setOutdatedBrowserWarningLastShown.bind(
|
appStateController.setOutdatedBrowserWarningLastShown.bind(
|
||||||
appStateController,
|
appStateController,
|
||||||
|
@ -658,8 +658,6 @@
|
|||||||
"ui/components/app/qr-hardware-popover/qr-hardware-sign-request/reader.js",
|
"ui/components/app/qr-hardware-popover/qr-hardware-sign-request/reader.js",
|
||||||
"ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/index.js",
|
"ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/index.js",
|
||||||
"ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/qr-hardware-wallet-importer.component.js",
|
"ui/components/app/qr-hardware-popover/qr-hardware-wallet-importer/qr-hardware-wallet-importer.component.js",
|
||||||
"ui/components/app/recovery-phrase-reminder/index.js",
|
|
||||||
"ui/components/app/recovery-phrase-reminder/recovery-phrase-reminder.js",
|
|
||||||
"ui/components/app/selected-account/index.js",
|
"ui/components/app/selected-account/index.js",
|
||||||
"ui/components/app/selected-account/selected-account-component.test.js",
|
"ui/components/app/selected-account/selected-account-component.test.js",
|
||||||
"ui/components/app/selected-account/selected-account.component.js",
|
"ui/components/app/selected-account/selected-account.component.js",
|
||||||
|
@ -60,7 +60,6 @@
|
|||||||
@import 'permissions-connect-header/index';
|
@import 'permissions-connect-header/index';
|
||||||
@import 'permissions-connect-permission-list/index';
|
@import 'permissions-connect-permission-list/index';
|
||||||
@import 'permission-cell/index';
|
@import 'permission-cell/index';
|
||||||
@import 'recovery-phrase-reminder/index';
|
|
||||||
@import 'set-approval-for-all-warning/index';
|
@import 'set-approval-for-all-warning/index';
|
||||||
@import 'step-progress-bar/index.scss';
|
@import 'step-progress-bar/index.scss';
|
||||||
@import 'selected-account/index';
|
@import 'selected-account/index';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useContext, useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import ImportTokenLink from '../import-token-link';
|
import ImportTokenLink from '../import-token-link';
|
||||||
@ -23,11 +23,6 @@ import {
|
|||||||
TEXT_ALIGN,
|
TEXT_ALIGN,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
||||||
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
|
||||||
import {
|
|
||||||
MetaMetricsEventCategory,
|
|
||||||
MetaMetricsEventName,
|
|
||||||
} from '../../../../shared/constants/metametrics';
|
|
||||||
import DetectedToken from '../detected-token/detected-token';
|
import DetectedToken from '../detected-token/detected-token';
|
||||||
import {
|
import {
|
||||||
DetectedTokensBanner,
|
DetectedTokensBanner,
|
||||||
@ -45,7 +40,6 @@ const AssetList = ({ onClickAsset }) => {
|
|||||||
const selectedAccountBalance = useSelector(getSelectedAccountCachedBalance);
|
const selectedAccountBalance = useSelector(getSelectedAccountCachedBalance);
|
||||||
const nativeCurrency = useSelector(getNativeCurrency);
|
const nativeCurrency = useSelector(getNativeCurrency);
|
||||||
const showFiat = useSelector(getShouldShowFiat);
|
const showFiat = useSelector(getShouldShowFiat);
|
||||||
const trackEvent = useContext(MetaMetricsContext);
|
|
||||||
const balance = useSelector(getSelectedAccountCachedBalance);
|
const balance = useSelector(getSelectedAccountCachedBalance);
|
||||||
const balanceIsLoading = !balance;
|
const balanceIsLoading = !balance;
|
||||||
|
|
||||||
@ -112,14 +106,6 @@ const AssetList = ({ onClickAsset }) => {
|
|||||||
<TokenList
|
<TokenList
|
||||||
onTokenClick={(tokenAddress) => {
|
onTokenClick={(tokenAddress) => {
|
||||||
onClickAsset(tokenAddress);
|
onClickAsset(tokenAddress);
|
||||||
trackEvent({
|
|
||||||
event: MetaMetricsEventName.TokenScreenOpened,
|
|
||||||
category: MetaMetricsEventCategory.Navigation,
|
|
||||||
properties: {
|
|
||||||
token_symbol: primaryCurrencyProperties.suffix,
|
|
||||||
location: 'Home',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{detectedTokens.length > 0 &&
|
{detectedTokens.length > 0 &&
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export { default } from './recovery-phrase-reminder';
|
|
@ -1,10 +0,0 @@
|
|||||||
.recovery-phrase-reminder {
|
|
||||||
&__list {
|
|
||||||
list-style: disc;
|
|
||||||
padding-left: 20px;
|
|
||||||
|
|
||||||
li {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import { useHistory } from 'react-router-dom';
|
|
||||||
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
||||||
// Components
|
|
||||||
import Box from '../../ui/box';
|
|
||||||
import Button from '../../ui/button';
|
|
||||||
import Popover from '../../ui/popover';
|
|
||||||
import Typography from '../../ui/typography';
|
|
||||||
// Helpers
|
|
||||||
import {
|
|
||||||
DISPLAY,
|
|
||||||
TEXT_ALIGN,
|
|
||||||
TypographyVariant,
|
|
||||||
BLOCK_SIZES,
|
|
||||||
FONT_WEIGHT,
|
|
||||||
JustifyContent,
|
|
||||||
TextColor,
|
|
||||||
} from '../../../helpers/constants/design-system';
|
|
||||||
import { ONBOARDING_UNLOCK_ROUTE } from '../../../helpers/constants/routes';
|
|
||||||
|
|
||||||
export default function RecoveryPhraseReminder({ onConfirm, hasBackedUp }) {
|
|
||||||
const t = useI18nContext();
|
|
||||||
const history = useHistory();
|
|
||||||
|
|
||||||
const handleBackUp = () => {
|
|
||||||
history.push(ONBOARDING_UNLOCK_ROUTE);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Popover centerTitle title={t('recoveryPhraseReminderTitle')}>
|
|
||||||
<Box
|
|
||||||
paddingRight={4}
|
|
||||||
paddingBottom={6}
|
|
||||||
paddingLeft={4}
|
|
||||||
className="recovery-phrase-reminder"
|
|
||||||
>
|
|
||||||
<Typography
|
|
||||||
color={TextColor.textDefault}
|
|
||||||
align={TEXT_ALIGN.CENTER}
|
|
||||||
variant={TypographyVariant.paragraph}
|
|
||||||
boxProps={{ marginTop: 0, marginBottom: 4 }}
|
|
||||||
>
|
|
||||||
{t('recoveryPhraseReminderSubText')}
|
|
||||||
</Typography>
|
|
||||||
<Box marginTop={4} marginBottom={8}>
|
|
||||||
<ul className="recovery-phrase-reminder__list">
|
|
||||||
<li>
|
|
||||||
<Typography
|
|
||||||
as="span"
|
|
||||||
color={TextColor.textDefault}
|
|
||||||
fontWeight={FONT_WEIGHT.BOLD}
|
|
||||||
>
|
|
||||||
{t('recoveryPhraseReminderItemOne')}
|
|
||||||
</Typography>
|
|
||||||
</li>
|
|
||||||
<li>{t('recoveryPhraseReminderItemTwo')}</li>
|
|
||||||
<li>
|
|
||||||
{hasBackedUp ? (
|
|
||||||
t('recoveryPhraseReminderHasBackedUp')
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
{t('recoveryPhraseReminderHasNotBackedUp')}
|
|
||||||
<Box display={DISPLAY.INLINE_BLOCK} marginLeft={1}>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
onClick={handleBackUp}
|
|
||||||
style={{
|
|
||||||
fontSize: 'inherit',
|
|
||||||
padding: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t('recoveryPhraseReminderBackupStart')}
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</Box>
|
|
||||||
<Box justifyContent={JustifyContent.center}>
|
|
||||||
<Box width={BLOCK_SIZES.TWO_FIFTHS}>
|
|
||||||
<Button type="primary" onClick={onConfirm}>
|
|
||||||
{t('recoveryPhraseReminderConfirm')}
|
|
||||||
</Button>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
</Box>
|
|
||||||
</Popover>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
RecoveryPhraseReminder.propTypes = {
|
|
||||||
hasBackedUp: PropTypes.bool.isRequired,
|
|
||||||
onConfirm: PropTypes.func.isRequired,
|
|
||||||
};
|
|
@ -15,7 +15,6 @@ import ConnectedAccounts from '../connected-accounts';
|
|||||||
import { Tabs, Tab } from '../../components/ui/tabs';
|
import { Tabs, Tab } from '../../components/ui/tabs';
|
||||||
import { EthOverview } from '../../components/app/wallet-overview';
|
import { EthOverview } from '../../components/app/wallet-overview';
|
||||||
import WhatsNewPopup from '../../components/app/whats-new-popup';
|
import WhatsNewPopup from '../../components/app/whats-new-popup';
|
||||||
import RecoveryPhraseReminder from '../../components/app/recovery-phrase-reminder';
|
|
||||||
import ActionableMessage from '../../components/ui/actionable-message/actionable-message';
|
import ActionableMessage from '../../components/ui/actionable-message/actionable-message';
|
||||||
import {
|
import {
|
||||||
FONT_WEIGHT,
|
FONT_WEIGHT,
|
||||||
@ -44,7 +43,6 @@ import {
|
|||||||
VIEW_QUOTE_ROUTE,
|
VIEW_QUOTE_ROUTE,
|
||||||
CONFIRMATION_V_NEXT_ROUTE,
|
CONFIRMATION_V_NEXT_ROUTE,
|
||||||
ADD_NFT_ROUTE,
|
ADD_NFT_ROUTE,
|
||||||
ONBOARDING_SECURE_YOUR_WALLET_ROUTE,
|
|
||||||
} from '../../helpers/constants/routes';
|
} from '../../helpers/constants/routes';
|
||||||
import ZENDESK_URLS from '../../helpers/constants/zendesk-url';
|
import ZENDESK_URLS from '../../helpers/constants/zendesk-url';
|
||||||
|
|
||||||
@ -71,7 +69,6 @@ export default class Home extends PureComponent {
|
|||||||
forgottenPassword: PropTypes.bool,
|
forgottenPassword: PropTypes.bool,
|
||||||
suggestedAssets: PropTypes.array,
|
suggestedAssets: PropTypes.array,
|
||||||
unconfirmedTransactionsCount: PropTypes.number,
|
unconfirmedTransactionsCount: PropTypes.number,
|
||||||
shouldShowSeedPhraseReminder: PropTypes.bool.isRequired,
|
|
||||||
isPopup: PropTypes.bool,
|
isPopup: PropTypes.bool,
|
||||||
isNotification: PropTypes.bool.isRequired,
|
isNotification: PropTypes.bool.isRequired,
|
||||||
firstPermissionsRequestId: PropTypes.string,
|
firstPermissionsRequestId: PropTypes.string,
|
||||||
@ -101,21 +98,8 @@ export default class Home extends PureComponent {
|
|||||||
shouldShowErrors: PropTypes.bool.isRequired,
|
shouldShowErrors: PropTypes.bool.isRequired,
|
||||||
removeSnapError: PropTypes.func.isRequired,
|
removeSnapError: PropTypes.func.isRequired,
|
||||||
///: END:ONLY_INCLUDE_IN
|
///: END:ONLY_INCLUDE_IN
|
||||||
showRecoveryPhraseReminder: PropTypes.bool.isRequired,
|
|
||||||
setRecoveryPhraseReminderHasBeenShown: PropTypes.func.isRequired,
|
|
||||||
setRecoveryPhraseReminderLastShown: PropTypes.func.isRequired,
|
|
||||||
showOutdatedBrowserWarning: PropTypes.bool.isRequired,
|
showOutdatedBrowserWarning: PropTypes.bool.isRequired,
|
||||||
setOutdatedBrowserWarningLastShown: PropTypes.func.isRequired,
|
setOutdatedBrowserWarningLastShown: PropTypes.func.isRequired,
|
||||||
seedPhraseBackedUp: (props) => {
|
|
||||||
if (
|
|
||||||
props.seedPhraseBackedUp !== null &&
|
|
||||||
typeof props.seedPhraseBackedUp !== 'boolean'
|
|
||||||
) {
|
|
||||||
throw new Error(
|
|
||||||
`seedPhraseBackedUp is required to be null or boolean. Received ${props.seedPhraseBackedUp}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
newNetworkAddedName: PropTypes.string,
|
newNetworkAddedName: PropTypes.string,
|
||||||
// This prop is used in the `shouldCloseNotificationPopup` function
|
// This prop is used in the `shouldCloseNotificationPopup` function
|
||||||
// eslint-disable-next-line react/no-unused-prop-types
|
// eslint-disable-next-line react/no-unused-prop-types
|
||||||
@ -218,15 +202,6 @@ export default class Home extends PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onRecoveryPhraseReminderClose = () => {
|
|
||||||
const {
|
|
||||||
setRecoveryPhraseReminderHasBeenShown,
|
|
||||||
setRecoveryPhraseReminderLastShown,
|
|
||||||
} = this.props;
|
|
||||||
setRecoveryPhraseReminderHasBeenShown(true);
|
|
||||||
setRecoveryPhraseReminderLastShown(new Date().getTime());
|
|
||||||
};
|
|
||||||
|
|
||||||
onOutdatedBrowserWarningClose = () => {
|
onOutdatedBrowserWarningClose = () => {
|
||||||
const { setOutdatedBrowserWarningLastShown } = this.props;
|
const { setOutdatedBrowserWarningLastShown } = this.props;
|
||||||
setOutdatedBrowserWarningLastShown(new Date().getTime());
|
setOutdatedBrowserWarningLastShown(new Date().getTime());
|
||||||
@ -236,9 +211,6 @@ export default class Home extends PureComponent {
|
|||||||
const { t } = this.context;
|
const { t } = this.context;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
history,
|
|
||||||
shouldShowSeedPhraseReminder,
|
|
||||||
isPopup,
|
|
||||||
shouldShowWeb3ShimUsageNotification,
|
shouldShowWeb3ShimUsageNotification,
|
||||||
setWeb3ShimUsageAlertDismissed,
|
setWeb3ShimUsageAlertDismissed,
|
||||||
originOfCurrentTab,
|
originOfCurrentTab,
|
||||||
@ -433,22 +405,6 @@ export default class Home extends PureComponent {
|
|||||||
key="home-web3ShimUsageNotification"
|
key="home-web3ShimUsageNotification"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{shouldShowSeedPhraseReminder ? (
|
|
||||||
<HomeNotification
|
|
||||||
descriptionText={t('backupApprovalNotice')}
|
|
||||||
acceptText={t('backupNow')}
|
|
||||||
onAccept={() => {
|
|
||||||
const backUpSRPRoute = `${ONBOARDING_SECURE_YOUR_WALLET_ROUTE}/?isFromReminder=true`;
|
|
||||||
if (isPopup) {
|
|
||||||
global.platform.openExtensionInBrowser(backUpSRPRoute);
|
|
||||||
} else {
|
|
||||||
history.push(backUpSRPRoute);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
infoText={t('backupApprovalInfo')}
|
|
||||||
key="home-backupApprovalNotice"
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{infuraBlocked && this.state.canShowBlockageNotification ? (
|
{infuraBlocked && this.state.canShowBlockageNotification ? (
|
||||||
<HomeNotification
|
<HomeNotification
|
||||||
descriptionText={t('infuraBlockedNotification', [
|
descriptionText={t('infuraBlockedNotification', [
|
||||||
@ -584,8 +540,6 @@ export default class Home extends PureComponent {
|
|||||||
announcementsToShow,
|
announcementsToShow,
|
||||||
showWhatsNewPopup,
|
showWhatsNewPopup,
|
||||||
hideWhatsNewPopup,
|
hideWhatsNewPopup,
|
||||||
seedPhraseBackedUp,
|
|
||||||
showRecoveryPhraseReminder,
|
|
||||||
firstTimeFlowType,
|
firstTimeFlowType,
|
||||||
completedOnboarding,
|
completedOnboarding,
|
||||||
onboardedInThisUISession,
|
onboardedInThisUISession,
|
||||||
@ -615,12 +569,6 @@ export default class Home extends PureComponent {
|
|||||||
/>
|
/>
|
||||||
<div className="home__container">
|
<div className="home__container">
|
||||||
{showWhatsNew ? <WhatsNewPopup onClose={hideWhatsNewPopup} /> : null}
|
{showWhatsNew ? <WhatsNewPopup onClose={hideWhatsNewPopup} /> : null}
|
||||||
{!showWhatsNew && showRecoveryPhraseReminder ? (
|
|
||||||
<RecoveryPhraseReminder
|
|
||||||
hasBackedUp={seedPhraseBackedUp}
|
|
||||||
onConfirm={this.onRecoveryPhraseReminderClose}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{isPopup && !connectedStatusPopoverHasBeenShown
|
{isPopup && !connectedStatusPopoverHasBeenShown
|
||||||
? this.renderPopover()
|
? this.renderPopover()
|
||||||
: null}
|
: null}
|
||||||
|
@ -16,14 +16,12 @@ import {
|
|||||||
getInfuraBlocked,
|
getInfuraBlocked,
|
||||||
getShowWhatsNewPopup,
|
getShowWhatsNewPopup,
|
||||||
getSortedAnnouncementsToShow,
|
getSortedAnnouncementsToShow,
|
||||||
getShowRecoveryPhraseReminder,
|
|
||||||
getShowOutdatedBrowserWarning,
|
getShowOutdatedBrowserWarning,
|
||||||
getNewNetworkAdded,
|
getNewNetworkAdded,
|
||||||
hasUnsignedQRHardwareTransaction,
|
hasUnsignedQRHardwareTransaction,
|
||||||
hasUnsignedQRHardwareMessage,
|
hasUnsignedQRHardwareMessage,
|
||||||
getNewNftAddedMessage,
|
getNewNftAddedMessage,
|
||||||
getNewTokensImported,
|
getNewTokensImported,
|
||||||
getShouldShowSeedPhraseReminder,
|
|
||||||
getRemoveNftMessage,
|
getRemoveNftMessage,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
|
|
||||||
@ -33,8 +31,6 @@ import {
|
|||||||
setDefaultHomeActiveTabName,
|
setDefaultHomeActiveTabName,
|
||||||
setWeb3ShimUsageAlertDismissed,
|
setWeb3ShimUsageAlertDismissed,
|
||||||
setAlertEnabledness,
|
setAlertEnabledness,
|
||||||
setRecoveryPhraseReminderHasBeenShown,
|
|
||||||
setRecoveryPhraseReminderLastShown,
|
|
||||||
setOutdatedBrowserWarningLastShown,
|
setOutdatedBrowserWarningLastShown,
|
||||||
setNewNetworkAdded,
|
setNewNetworkAdded,
|
||||||
setNewNftAddedMessage,
|
setNewNftAddedMessage,
|
||||||
@ -111,7 +107,6 @@ const mapStateToProps = (state) => {
|
|||||||
suggestedAssets,
|
suggestedAssets,
|
||||||
swapsEnabled,
|
swapsEnabled,
|
||||||
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),
|
unconfirmedTransactionsCount: unconfirmedTransactionsCountSelector(state),
|
||||||
shouldShowSeedPhraseReminder: getShouldShowSeedPhraseReminder(state),
|
|
||||||
isPopup,
|
isPopup,
|
||||||
isNotification,
|
isNotification,
|
||||||
selectedAddress,
|
selectedAddress,
|
||||||
@ -135,7 +130,6 @@ const mapStateToProps = (state) => {
|
|||||||
shouldShowErrors: Object.entries(metamask.snapErrors || []).length > 0,
|
shouldShowErrors: Object.entries(metamask.snapErrors || []).length > 0,
|
||||||
///: END:ONLY_INCLUDE_IN
|
///: END:ONLY_INCLUDE_IN
|
||||||
showWhatsNewPopup: getShowWhatsNewPopup(state),
|
showWhatsNewPopup: getShowWhatsNewPopup(state),
|
||||||
showRecoveryPhraseReminder: getShowRecoveryPhraseReminder(state),
|
|
||||||
showOutdatedBrowserWarning:
|
showOutdatedBrowserWarning:
|
||||||
getIsBrowserDeprecated() && getShowOutdatedBrowserWarning(state),
|
getIsBrowserDeprecated() && getShowOutdatedBrowserWarning(state),
|
||||||
seedPhraseBackedUp,
|
seedPhraseBackedUp,
|
||||||
@ -162,10 +156,6 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
disableWeb3ShimUsageAlert: () =>
|
disableWeb3ShimUsageAlert: () =>
|
||||||
setAlertEnabledness(AlertTypes.web3ShimUsage, false),
|
setAlertEnabledness(AlertTypes.web3ShimUsage, false),
|
||||||
hideWhatsNewPopup: () => dispatch(hideWhatsNewPopup()),
|
hideWhatsNewPopup: () => dispatch(hideWhatsNewPopup()),
|
||||||
setRecoveryPhraseReminderHasBeenShown: () =>
|
|
||||||
dispatch(setRecoveryPhraseReminderHasBeenShown()),
|
|
||||||
setRecoveryPhraseReminderLastShown: (lastShown) =>
|
|
||||||
dispatch(setRecoveryPhraseReminderLastShown(lastShown)),
|
|
||||||
setOutdatedBrowserWarningLastShown: (lastShown) => {
|
setOutdatedBrowserWarningLastShown: (lastShown) => {
|
||||||
dispatch(setOutdatedBrowserWarningLastShown(lastShown));
|
dispatch(setOutdatedBrowserWarningLastShown(lastShown));
|
||||||
},
|
},
|
||||||
|
@ -122,7 +122,6 @@ export default class Routes extends Component {
|
|||||||
allAccountsOnNetworkAreEmpty: PropTypes.bool,
|
allAccountsOnNetworkAreEmpty: PropTypes.bool,
|
||||||
isTestNet: PropTypes.bool,
|
isTestNet: PropTypes.bool,
|
||||||
currentChainId: PropTypes.string,
|
currentChainId: PropTypes.string,
|
||||||
shouldShowSeedPhraseReminder: PropTypes.bool,
|
|
||||||
forgottenPassword: PropTypes.bool,
|
forgottenPassword: PropTypes.bool,
|
||||||
isCurrentProviderCustom: PropTypes.bool,
|
isCurrentProviderCustom: PropTypes.bool,
|
||||||
completedOnboarding: PropTypes.bool,
|
completedOnboarding: PropTypes.bool,
|
||||||
@ -431,7 +430,6 @@ export default class Routes extends Component {
|
|||||||
allAccountsOnNetworkAreEmpty,
|
allAccountsOnNetworkAreEmpty,
|
||||||
isTestNet,
|
isTestNet,
|
||||||
currentChainId,
|
currentChainId,
|
||||||
shouldShowSeedPhraseReminder,
|
|
||||||
isCurrentProviderCustom,
|
isCurrentProviderCustom,
|
||||||
completedOnboarding,
|
completedOnboarding,
|
||||||
isAccountMenuOpen,
|
isAccountMenuOpen,
|
||||||
@ -454,9 +452,7 @@ export default class Routes extends Component {
|
|||||||
const windowType = getEnvironmentType();
|
const windowType = getEnvironmentType();
|
||||||
|
|
||||||
const shouldShowNetworkDeprecationWarning =
|
const shouldShowNetworkDeprecationWarning =
|
||||||
windowType !== ENVIRONMENT_TYPE_NOTIFICATION &&
|
windowType !== ENVIRONMENT_TYPE_NOTIFICATION && isUnlocked;
|
||||||
isUnlocked &&
|
|
||||||
!shouldShowSeedPhraseReminder;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -10,7 +10,6 @@ import {
|
|||||||
getTheme,
|
getTheme,
|
||||||
getIsTestnet,
|
getIsTestnet,
|
||||||
getCurrentChainId,
|
getCurrentChainId,
|
||||||
getShouldShowSeedPhraseReminder,
|
|
||||||
isCurrentProviderCustom,
|
isCurrentProviderCustom,
|
||||||
} from '../../selectors';
|
} from '../../selectors';
|
||||||
import {
|
import {
|
||||||
@ -52,7 +51,6 @@ function mapStateToProps(state) {
|
|||||||
allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state),
|
allAccountsOnNetworkAreEmpty: getAllAccountsOnNetworkAreEmpty(state),
|
||||||
isTestNet: getIsTestnet(state),
|
isTestNet: getIsTestnet(state),
|
||||||
currentChainId: getCurrentChainId(state),
|
currentChainId: getCurrentChainId(state),
|
||||||
shouldShowSeedPhraseReminder: getShouldShowSeedPhraseReminder(state),
|
|
||||||
forgottenPassword: state.metamask.forgottenPassword,
|
forgottenPassword: state.metamask.forgottenPassword,
|
||||||
isCurrentProviderCustom: isCurrentProviderCustom(state),
|
isCurrentProviderCustom: isCurrentProviderCustom(state),
|
||||||
completedOnboarding,
|
completedOnboarding,
|
||||||
|
@ -992,18 +992,6 @@ export function getSortedAnnouncementsToShow(state) {
|
|||||||
return announcementsSortedByDate;
|
return announcementsSortedByDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getShowRecoveryPhraseReminder(state) {
|
|
||||||
const {
|
|
||||||
recoveryPhraseReminderLastShown,
|
|
||||||
recoveryPhraseReminderHasBeenShown,
|
|
||||||
} = state.metamask;
|
|
||||||
|
|
||||||
const currentTime = new Date().getTime();
|
|
||||||
const frequency = recoveryPhraseReminderHasBeenShown ? DAY * 90 : DAY * 2;
|
|
||||||
|
|
||||||
return currentTime - recoveryPhraseReminderLastShown >= frequency;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getShowOutdatedBrowserWarning(state) {
|
export function getShowOutdatedBrowserWarning(state) {
|
||||||
const { outdatedBrowserWarningLastShown } = state.metamask;
|
const { outdatedBrowserWarningLastShown } = state.metamask;
|
||||||
if (!outdatedBrowserWarningLastShown) {
|
if (!outdatedBrowserWarningLastShown) {
|
||||||
@ -1385,17 +1373,6 @@ export function getAllAccountsOnNetworkAreEmpty(state) {
|
|||||||
return hasNoNativeFundsOnAnyAccounts && hasNoTokens;
|
return hasNoNativeFundsOnAnyAccounts && hasNoTokens;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getShouldShowSeedPhraseReminder(state) {
|
|
||||||
const { tokens, seedPhraseBackedUp, dismissSeedBackUpReminder } =
|
|
||||||
state.metamask;
|
|
||||||
const accountBalance = getCurrentEthBalance(state) ?? 0;
|
|
||||||
return (
|
|
||||||
seedPhraseBackedUp === false &&
|
|
||||||
(parseInt(accountBalance, 16) > 0 || tokens.length > 0) &&
|
|
||||||
dismissSeedBackUpReminder === false
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getCustomTokenAmount(state) {
|
export function getCustomTokenAmount(state) {
|
||||||
return state.appState.customTokenAmount;
|
return state.appState.customTokenAmount;
|
||||||
}
|
}
|
||||||
|
@ -3948,32 +3948,6 @@ export function setConnectedStatusPopoverHasBeenShown(): ThunkAction<
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setRecoveryPhraseReminderHasBeenShown() {
|
|
||||||
return () => {
|
|
||||||
callBackgroundMethod('setRecoveryPhraseReminderHasBeenShown', [], (err) => {
|
|
||||||
if (isErrorWithMessage(err)) {
|
|
||||||
throw new Error(err.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setRecoveryPhraseReminderLastShown(
|
|
||||||
lastShown: number,
|
|
||||||
): ThunkAction<void, MetaMaskReduxState, unknown, AnyAction> {
|
|
||||||
return () => {
|
|
||||||
callBackgroundMethod(
|
|
||||||
'setRecoveryPhraseReminderLastShown',
|
|
||||||
[lastShown],
|
|
||||||
(err) => {
|
|
||||||
if (isErrorWithMessage(err)) {
|
|
||||||
throw new Error(err.message);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setOutdatedBrowserWarningLastShown(lastShown: number) {
|
export function setOutdatedBrowserWarningLastShown(lastShown: number) {
|
||||||
return async () => {
|
return async () => {
|
||||||
await submitRequestToBackground('setOutdatedBrowserWarningLastShown', [
|
await submitRequestToBackground('setOutdatedBrowserWarningLastShown', [
|
||||||
|
Loading…
Reference in New Issue
Block a user