diff --git a/app/scripts/controllers/onboarding.js b/app/scripts/controllers/onboarding.js index 9e4a3eeda..812ba7e44 100644 --- a/app/scripts/controllers/onboarding.js +++ b/app/scripts/controllers/onboarding.js @@ -27,7 +27,7 @@ export default class OnboardingController { onboardingTabs: {}, }; const initState = { - seedPhraseBackedUp: false, + seedPhraseBackedUp: null, firstTimeFlowType: null, completedOnboarding: false, ...opts.initState, diff --git a/ui/pages/asset/components/asset-options.js b/ui/pages/asset/components/asset-options.js index 79583e7bc..c29efe099 100644 --- a/ui/pages/asset/components/asset-options.js +++ b/ui/pages/asset/components/asset-options.js @@ -4,8 +4,6 @@ import PropTypes from 'prop-types'; import { I18nContext } from '../../../contexts/i18n'; import { Menu, MenuItem } from '../../../components/ui/menu'; -const noop = () => {}; - const AssetOptions = ({ onRemove, onClickBlockExplorer, @@ -93,17 +91,17 @@ AssetOptions.propTypes = { onClickBlockExplorer: PropTypes.func.isRequired, onViewAccountDetails: PropTypes.func.isRequired, onRemove: (props, propName, componentName) => { - if (props.isNativeAsset === false && typeof(onRemove) !== "function") { + if (props.isNativeAsset === false && typeof(props.onRemove) !== "function") { throw new Error("When isNativeAsset is true, onRemove is a required prop"); } }, onViewTokenDetails: (props, propName, componentName) => { - if (props.isNativeAsset === false && typeof(onViewTokenDetails) !== "function") { + if (props.isNativeAsset === false && typeof(props.onViewTokenDetails) !== "function") { throw new Error("When isNativeAsset is true, onViewTokenDetails is a required prop"); } }, tokenSymbol: (props, propName, componentName) => { - if (props.isNativeAsset === false && typeof(tokenSymbol) !== "string") { + if (props.isNativeAsset === false && typeof(props.tokenSymbol) !== "string") { throw new Error("When isNativeAsset is true, tokenSymbol is a required prop"); } } diff --git a/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js b/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js index 42ef924e9..586db5915 100644 --- a/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js +++ b/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.component.js @@ -34,7 +34,7 @@ export default class FirstTimeFlowSwitch extends PureComponent { return ; } - if (seedPhraseBackedUp) { + if (seedPhraseBackedUp !== null) { return ; } diff --git a/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.test.js b/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.test.js index 3f4662c69..e07331222 100644 --- a/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.test.js +++ b/ui/pages/first-time-flow/first-time-flow-switch/first-time-flow-switch.test.js @@ -15,7 +15,7 @@ describe('FirstTimeFlowSwitch', () => { completedOnboarding: null, isInitialized: null, isUnlocked: null, - seedPhraseBackedUp: false, + seedPhraseBackedUp: null, }; const wrapper = mountWithRouter( , @@ -76,7 +76,7 @@ describe('FirstTimeFlowSwitch', () => { const props = { completedOnboarding: false, isUnlocked: true, - seedPhraseBackedUp: false, + seedPhraseBackedUp: null, }; const wrapper = mountWithRouter( @@ -93,7 +93,7 @@ describe('FirstTimeFlowSwitch', () => { completedOnboarding: false, isUnlocked: false, isInitialized: false, - seedPhraseBackedUp: false, + seedPhraseBackedUp: null, }; const wrapper = mountWithRouter( @@ -112,7 +112,7 @@ describe('FirstTimeFlowSwitch', () => { completedOnboarding: false, isUnlocked: false, isInitialized: true, - seedPhraseBackedUp: false, + seedPhraseBackedUp: null, }; const wrapper = mountWithRouter( diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js index 64f111f07..d87df82aa 100644 --- a/ui/pages/home/home.component.js +++ b/ui/pages/home/home.component.js @@ -123,7 +123,13 @@ export default class Home extends PureComponent { showRecoveryPhraseReminder: PropTypes.bool.isRequired, setRecoveryPhraseReminderHasBeenShown: PropTypes.func.isRequired, setRecoveryPhraseReminderLastShown: PropTypes.func.isRequired, - seedPhraseBackedUp: PropTypes.bool.isRequired, + seedPhraseBackedUp: (props, propName, componentName) => { + if (props.seedPhraseBackedUp !== null && typeof(props.seedPhraseBackedUp) !== "boolean") { + throw new Error( + `seedPhraseBackedUp is required to be null or boolean. Received ${props.seedPhraseBackedUp}` + ); + } + }, newNetworkAdded: PropTypes.string, setNewNetworkAdded: PropTypes.func.isRequired, // This prop is used in the `shouldCloseNotificationPopup` function diff --git a/ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.js b/ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.js index a89d1597a..24c8310ed 100644 --- a/ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.js +++ b/ui/pages/onboarding-flow/onboarding-flow-switch/onboarding-flow-switch.js @@ -31,7 +31,7 @@ export default function OnboardingFlowSwitch() { return ; } - if (seedPhraseBackedUp) { + if (seedPhraseBackedUp !== null) { return ; }