Skip to content

Commit

Permalink
Backport "Delete Dai/Sai migration notification (#8418)"
Browse files Browse the repository at this point in the history
This backports the deletion of the Dai/Sai migration notification
(#8418). Note that the migration to delete the now unused background
state has not been included, as it is non-essential and would have been
more difficult to backport. The migration to delete the unused state
will be included in the next major release instead.
  • Loading branch information
whymarrh authored and Gudahtt committed Apr 29, 2020
1 parent 8fb615c commit f370eed
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 159 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## 7.7.9 Tue Apr 28 2020
- [#8446](https://github.com/MetaMask/metamask-extension/pull/8446): Fix popup not opening
- [#8449](https://github.com/MetaMask/metamask-extension/pull/8449): Skip adding history entry for empty txMeta diffs
- [#8447](https://github.com/MetaMask/metamask-extension/pull/8447): Delete Dai/Sai migration notification

## 7.7.8 Wed Mar 11 2020
- [#8176](https://github.com/MetaMask/metamask-extension/pull/8176): Handle and set gas estimation when max mode is clicked
Expand Down
9 changes: 0 additions & 9 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
{
"migrateSai": {
"message": "A message from Maker: The new Multi-Collateral Dai token has been released. Your old tokens are now called Sai. Please upgrade your Sai tokens to the new Dai."
},
"migrateSaiInfo": {
"message": "To dismiss this notification you can migrate your tokens or hide SAI from the token list."
},
"migrate": {
"message": "Migrate"
},
"showIncomingTransactions": {
"message": "Show Incoming Transactions"
},
Expand Down
7 changes: 0 additions & 7 deletions app/scripts/controllers/app-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class AppStateController {
this.onInactiveTimeout = onInactiveTimeout || (() => {})
this.store = new ObservableStore(extend({
timeoutMinutes: 0,
mkrMigrationReminderTimestamp: null,
}, initState))
this.timer = null

Expand All @@ -24,12 +23,6 @@ class AppStateController {
this._setInactiveTimeout(preferences.autoLogoutTimeLimit)
}

setMkrMigrationReminderTimestamp (timestamp) {
this.store.updateState({
mkrMigrationReminderTimestamp: timestamp,
})
}

/**
* Sets the last active time to the current time
* @return {void}
Expand Down
1 change: 0 additions & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ module.exports = class MetamaskController extends EventEmitter {

// AppStateController
setLastActiveTime: nodeify(this.appStateController.setLastActiveTime, this.appStateController),
setMkrMigrationReminderTimestamp: nodeify(this.appStateController.setMkrMigrationReminderTimestamp, this.appStateController),

// EnsController
tryReverseResolveAddress: nodeify(this.ensController.reverseResolveAddress, this.ensController),
Expand Down

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion ui/app/components/app/dai-migration-component/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions ui/app/pages/home/home.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Media from 'react-media'
import { Redirect } from 'react-router-dom'
import { formatDate } from '../../helpers/utils/util'
import HomeNotification from '../../components/app/home-notification'
import DaiMigrationNotification from '../../components/app/dai-migration-component'
import MultipleNotifications from '../../components/app/multiple-notifications'
import WalletView from '../../components/app/wallet-view'
import TransactionView from '../../components/app/transaction-view'
Expand All @@ -24,7 +23,6 @@ export default class Home extends PureComponent {

static defaultProps = {
unsetMigratedPrivacyMode: null,
hasDaiV1Token: false,
}

static propTypes = {
Expand All @@ -45,7 +43,6 @@ export default class Home extends PureComponent {
restoreFromThreeBox: PropTypes.func,
setShowRestorePromptToFalse: PropTypes.func,
threeBoxLastUpdated: PropTypes.number,
hasDaiV1Token: PropTypes.bool,
}

componentWillMount () {
Expand Down Expand Up @@ -89,7 +86,6 @@ export default class Home extends PureComponent {
forgottenPassword,
providerRequests,
history,
hasDaiV1Token,
showPrivacyModeNotification,
unsetMigratedPrivacyMode,
shouldShowSeedPhraseReminder,
Expand Down Expand Up @@ -176,11 +172,6 @@ export default class Home extends PureComponent {
/>
: null
}
{
hasDaiV1Token
? <DaiMigrationNotification />
: null
}
</MultipleNotifications>
</TransactionView>
)
Expand Down
3 changes: 1 addition & 2 deletions ui/app/pages/home/home.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { compose } from 'recompose'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import { unconfirmedTransactionsCountSelector } from '../../selectors/confirm-transaction'
import { getCurrentEthBalance, getDaiV1Token } from '../../selectors/selectors'
import { getCurrentEthBalance } from '../../selectors/selectors'
import {
unsetMigratedPrivacyMode,
restoreFromThreeBox,
Expand Down Expand Up @@ -44,7 +44,6 @@ const mapStateToProps = state => {
showRestorePrompt,
selectedAddress,
threeBoxLastUpdated,
hasDaiV1Token: Boolean(getDaiV1Token(state)),
}
}

Expand Down
7 changes: 0 additions & 7 deletions ui/app/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const selectors = {
getAccountType,
getNumberOfAccounts,
getNumberOfTokens,
getDaiV1Token,
isEthereumNetwork,
getMetaMetricState,
getRpcPrefsForCurrentProvider,
Expand Down Expand Up @@ -226,12 +225,6 @@ function getAddressBookEntryName (state, address) {
return entry && entry.name !== '' ? entry.name : addressSlicer(address)
}

function getDaiV1Token (state) {
const OLD_DAI_CONTRACT_ADDRESS = '0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359'
const tokens = state.metamask.tokens || []
return tokens.find(({address}) => checksumAddress(address) === OLD_DAI_CONTRACT_ADDRESS)
}

function accountsWithSendEtherInfoSelector (state) {
const accounts = getMetaMaskAccounts(state)
const { identities } = state.metamask
Expand Down
11 changes: 0 additions & 11 deletions ui/app/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ var actions = {
// AppStateController-related actions
SET_LAST_ACTIVE_TIME: 'SET_LAST_ACTIVE_TIME',
setLastActiveTime,
setMkrMigrationReminderTimestamp,

getContractMethodData,
loadingMethoDataStarted,
Expand Down Expand Up @@ -2756,16 +2755,6 @@ function setLastActiveTime () {
}
}

function setMkrMigrationReminderTimestamp (timestamp) {
return (dispatch) => {
background.setMkrMigrationReminderTimestamp(timestamp, (err) => {
if (err) {
return dispatch(actions.displayWarning(err.message))
}
})
}
}

function loadingMethoDataStarted () {
return {
type: actions.LOADING_METHOD_DATA_STARTED,
Expand Down

0 comments on commit f370eed

Please sign in to comment.