mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Remove UiMigrationAnnouncement and associated state (#6794)
This commit is contained in:
parent
714cf72fc3
commit
df17853502
@ -55,7 +55,6 @@ class PreferencesController {
|
|||||||
useNativeCurrencyAsPrimaryCurrency: true,
|
useNativeCurrencyAsPrimaryCurrency: true,
|
||||||
},
|
},
|
||||||
completedOnboarding: false,
|
completedOnboarding: false,
|
||||||
completedUiMigration: true,
|
|
||||||
metaMetricsId: null,
|
metaMetricsId: null,
|
||||||
metaMetricsSendCount: 0,
|
metaMetricsSendCount: 0,
|
||||||
}, opts.initState)
|
}, opts.initState)
|
||||||
@ -613,14 +612,6 @@ class PreferencesController {
|
|||||||
return Promise.resolve(true)
|
return Promise.resolve(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the {@code completedUiMigration} state to {@code true}, indicating that the user has completed the UI switch.
|
|
||||||
*/
|
|
||||||
completeUiMigration () {
|
|
||||||
this.store.updateState({ completedUiMigration: true })
|
|
||||||
return Promise.resolve(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// PRIVATE METHODS
|
// PRIVATE METHODS
|
||||||
//
|
//
|
||||||
|
@ -454,7 +454,6 @@ module.exports = class MetamaskController extends EventEmitter {
|
|||||||
setAccountLabel: nodeify(preferencesController.setAccountLabel, preferencesController),
|
setAccountLabel: nodeify(preferencesController.setAccountLabel, preferencesController),
|
||||||
setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
|
setFeatureFlag: nodeify(preferencesController.setFeatureFlag, preferencesController),
|
||||||
setPreference: nodeify(preferencesController.setPreference, preferencesController),
|
setPreference: nodeify(preferencesController.setPreference, preferencesController),
|
||||||
completeUiMigration: nodeify(preferencesController.completeUiMigration, preferencesController),
|
|
||||||
completeOnboarding: nodeify(preferencesController.completeOnboarding, preferencesController),
|
completeOnboarding: nodeify(preferencesController.completeOnboarding, preferencesController),
|
||||||
addKnownMethodData: nodeify(preferencesController.addKnownMethodData, preferencesController),
|
addKnownMethodData: nodeify(preferencesController.addKnownMethodData, preferencesController),
|
||||||
|
|
||||||
|
@ -134,7 +134,6 @@
|
|||||||
"useNativeCurrencyAsPrimaryCurrency": true,
|
"useNativeCurrencyAsPrimaryCurrency": true,
|
||||||
"showFiatInTestnets": true
|
"showFiatInTestnets": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -157,7 +157,6 @@
|
|||||||
"preferences": {
|
"preferences": {
|
||||||
"useNativeCurrencyAsPrimaryCurrency": true
|
"useNativeCurrencyAsPrimaryCurrency": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -116,7 +116,6 @@
|
|||||||
"useNativeCurrencyAsPrimaryCurrency": true,
|
"useNativeCurrencyAsPrimaryCurrency": true,
|
||||||
"showFiatInTestnets": true
|
"showFiatInTestnets": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -138,7 +138,6 @@
|
|||||||
"useNativeCurrencyAsPrimaryCurrency": true,
|
"useNativeCurrencyAsPrimaryCurrency": true,
|
||||||
"showFiatInTestnets": true
|
"showFiatInTestnets": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -117,7 +117,6 @@
|
|||||||
"useNativeCurrencyAsPrimaryCurrency": true,
|
"useNativeCurrencyAsPrimaryCurrency": true,
|
||||||
"showFiatInTestnets": true
|
"showFiatInTestnets": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -1059,7 +1059,6 @@
|
|||||||
"preferences": {
|
"preferences": {
|
||||||
"useNativeCurrencyAsPrimaryCurrency": true
|
"useNativeCurrencyAsPrimaryCurrency": true
|
||||||
},
|
},
|
||||||
"completedUiMigration": true,
|
|
||||||
"frequentRpcListDetail": []
|
"frequentRpcListDetail": []
|
||||||
},
|
},
|
||||||
"appState": {
|
"appState": {
|
||||||
|
@ -77,5 +77,3 @@
|
|||||||
@import 'gas-customization/index';
|
@import 'gas-customization/index';
|
||||||
|
|
||||||
@import 'gas-customization/gas-price-button-group/index';
|
@import 'gas-customization/gas-price-button-group/index';
|
||||||
|
|
||||||
@import 'ui-migration-annoucement/index';
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
export {default} from './ui-migration-announcement.container'
|
|
@ -1,22 +0,0 @@
|
|||||||
.ui-migration-announcement {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 9999;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
background: $white;
|
|
||||||
|
|
||||||
p {
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 1em;
|
|
||||||
font-size: 12pt;
|
|
||||||
}
|
|
||||||
|
|
||||||
p:last-of-type {
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: underline;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
import PropTypes from 'prop-types'
|
|
||||||
import React, {PureComponent} from 'react'
|
|
||||||
|
|
||||||
export default class UiMigrationAnnouncement extends PureComponent {
|
|
||||||
static contextTypes = {
|
|
||||||
t: PropTypes.func.isRequired,
|
|
||||||
}
|
|
||||||
|
|
||||||
static defaultProps = {
|
|
||||||
shouldShowAnnouncement: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
static propTypes = {
|
|
||||||
onClose: PropTypes.func.isRequired,
|
|
||||||
shouldShowAnnouncement: PropTypes.bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
render () {
|
|
||||||
const { t } = this.context
|
|
||||||
const { onClose, shouldShowAnnouncement } = this.props
|
|
||||||
|
|
||||||
if (!shouldShowAnnouncement) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="ui-migration-announcement">
|
|
||||||
<p>{t('uiMigrationAnnouncement')}</p>
|
|
||||||
<p onClick={onClose}>{t('close')}</p>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
import { connect } from 'react-redux'
|
|
||||||
import UiMigrationAnnouncement from './ui-migration-annoucement.component'
|
|
||||||
import { setCompletedUiMigration } from '../../../store/actions'
|
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
|
||||||
const shouldShowAnnouncement = !state.metamask.completedUiMigration
|
|
||||||
|
|
||||||
return {
|
|
||||||
shouldShowAnnouncement,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const mapDispatchToProps = dispatch => {
|
|
||||||
return {
|
|
||||||
onClose () {
|
|
||||||
dispatch(setCompletedUiMigration())
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(UiMigrationAnnouncement)
|
|
@ -403,12 +403,6 @@ function reduceMetamask (state, action) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
case actions.COMPLETE_UI_MIGRATION: {
|
|
||||||
return extend(metamaskState, {
|
|
||||||
completedUiMigration: true,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
case actions.SET_FIRST_TIME_FLOW_TYPE: {
|
case actions.SET_FIRST_TIME_FLOW_TYPE: {
|
||||||
return extend(metamaskState, {
|
return extend(metamaskState, {
|
||||||
firstTimeFlowType: action.value,
|
firstTimeFlowType: action.value,
|
||||||
|
@ -24,7 +24,6 @@ import Settings from '../settings'
|
|||||||
import Authenticated from '../../helpers/higher-order-components/authenticated'
|
import Authenticated from '../../helpers/higher-order-components/authenticated'
|
||||||
import Initialized from '../../helpers/higher-order-components/initialized'
|
import Initialized from '../../helpers/higher-order-components/initialized'
|
||||||
import Lock from '../lock'
|
import Lock from '../lock'
|
||||||
import UiMigrationAnnouncement from '../../components/app/ui-migration-annoucement'
|
|
||||||
const RestoreVaultPage = require('../keychains/restore-vault').default
|
const RestoreVaultPage = require('../keychains/restore-vault').default
|
||||||
const RevealSeedConfirmation = require('../keychains/reveal-seed')
|
const RevealSeedConfirmation = require('../keychains/reveal-seed')
|
||||||
const MobileSyncPage = require('../mobile-sync')
|
const MobileSyncPage = require('../mobile-sync')
|
||||||
@ -214,7 +213,6 @@ class Routes extends Component {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<UiMigrationAnnouncement />
|
|
||||||
<Modal />
|
<Modal />
|
||||||
<Alert
|
<Alert
|
||||||
visible={this.props.alertOpen}
|
visible={this.props.alertOpen}
|
||||||
|
@ -321,11 +321,6 @@ var actions = {
|
|||||||
setShowFiatConversionOnTestnetsPreference,
|
setShowFiatConversionOnTestnetsPreference,
|
||||||
setAutoLogoutTimeLimit,
|
setAutoLogoutTimeLimit,
|
||||||
|
|
||||||
// Migration of users to new UI
|
|
||||||
setCompletedUiMigration,
|
|
||||||
completeUiMigration,
|
|
||||||
COMPLETE_UI_MIGRATION: 'COMPLETE_UI_MIGRATION',
|
|
||||||
|
|
||||||
// Onboarding
|
// Onboarding
|
||||||
setCompletedOnboarding,
|
setCompletedOnboarding,
|
||||||
completeOnboarding,
|
completeOnboarding,
|
||||||
@ -2513,31 +2508,6 @@ function completeOnboarding () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCompletedUiMigration () {
|
|
||||||
return dispatch => {
|
|
||||||
dispatch(actions.showLoadingIndication())
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
background.completeUiMigration(err => {
|
|
||||||
dispatch(actions.hideLoadingIndication())
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
dispatch(actions.displayWarning(err.message))
|
|
||||||
return reject(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch(actions.completeUiMigration())
|
|
||||||
resolve()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function completeUiMigration () {
|
|
||||||
return {
|
|
||||||
type: actions.COMPLETE_UI_MIGRATION,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNetworkNonce (networkNonce) {
|
function setNetworkNonce (networkNonce) {
|
||||||
return {
|
return {
|
||||||
type: actions.SET_NETWORK_NONCE,
|
type: actions.SET_NETWORK_NONCE,
|
||||||
|
Loading…
Reference in New Issue
Block a user