Phase out extra warning screen.

feature/default_network_editable
Kevin Serrano 8 years ago
parent 16e2f029d8
commit 678301a20e
No known key found for this signature in database
GPG Key ID: 7CC862A58D2889B4
  1. 1
      app/scripts/keyring-controller.js
  2. 15
      app/scripts/lib/config-manager.js
  3. 1
      app/scripts/lib/idStore.js
  4. 10
      app/scripts/metamask-controller.js
  5. 2
      development/states.js
  6. 3
      development/states/accounts.json
  7. 1
      development/states/custom-rpc.json
  8. 1
      development/states/locked.json
  9. 3
      development/states/pending-signature.json
  10. 3
      development/states/restore-vault.json
  11. 3
      development/states/send.json
  12. 3
      development/states/shapeshift.json
  13. 35
      development/states/terms.json
  14. 3
      test/integration/lib/first-time.js
  15. 1
      ui/app/account-detail.js
  16. 23
      ui/app/actions.js
  17. 5
      ui/app/app.js
  18. 89
      ui/app/eth-store-warning.js
  19. 5
      ui/app/reducers/app.js
  20. 6
      ui/app/reducers/metamask.js

@ -39,7 +39,6 @@ module.exports = class KeyringController extends EventEmitter {
isInitialized: !!this.configManager.getVault(),
isUnlocked: !!this.key,
isConfirmed: true, // AUDIT this.configManager.getConfirmed(),
isEthConfirmed: this.configManager.getShouldntShowWarning(),
unconfTxs: this.configManager.unconfirmedTxs(),
transactions: this.configManager.getTxList(),
unconfMsgs: messageManager.unconfirmedMsgs(),

@ -368,21 +368,6 @@ ConfigManager.prototype.getConversionDate = function () {
return (('conversionDate' in data) && data.conversionDate) || 'N/A'
}
ConfigManager.prototype.setShouldntShowWarning = function () {
var data = this.getData()
if (data.isEthConfirmed) {
data.isEthConfirmed = !data.isEthConfirmed
} else {
data.isEthConfirmed = true
}
this.setData(data)
}
ConfigManager.prototype.getShouldntShowWarning = function () {
var data = this.getData()
return ('isEthConfirmed' in data) && data.isEthConfirmed
}
ConfigManager.prototype.getShapeShiftTxList = function () {
var data = this.getData()
var shapeShiftTxList = data.shapeShiftTxList ? data.shapeShiftTxList : []

@ -103,7 +103,6 @@ IdentityStore.prototype.getState = function () {
isUnlocked: this._isUnlocked(),
seedWords: seedWords,
isConfirmed: configManager.getConfirmed(),
isEthConfirmed: configManager.getShouldntShowWarning(),
unconfTxs: configManager.unconfirmedTxs(),
transactions: configManager.getTxList(),
unconfMsgs: messageManager.unconfirmedMsgs(),

@ -54,7 +54,6 @@ module.exports = class MetamaskController {
agreeToDisclaimer: this.agreeToDisclaimer.bind(this),
resetDisclaimer: this.resetDisclaimer.bind(this),
setCurrentFiat: this.setCurrentFiat.bind(this),
agreeToEthWarning: this.agreeToEthWarning.bind(this),
setTOSHash: this.setTOSHash.bind(this),
checkTOSChange: this.checkTOSChange.bind(this),
setGasMultiplier: this.setGasMultiplier.bind(this),
@ -334,15 +333,6 @@ module.exports = class MetamaskController {
}, 300000)
}
agreeToEthWarning (cb) {
try {
this.configManager.setShouldntShowWarning()
cb()
} catch (e) {
cb(e)
}
}
// called from popup
setRpcTarget (rpcTarget) {
this.configManager.setRpcTarget(rpcTarget)

File diff suppressed because one or more lines are too long

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": true,
"isUnlocked": true,
"isEthConfirmed": true,
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {
"0x0abdd95cafcabec9b3e99dcd09fc4b441037cb80": {
@ -116,4 +115,4 @@
"scrollToBottom": true
},
"identities": {}
}
}

@ -161,7 +161,6 @@
"network": "166",
"seedWords": null,
"isConfirmed": true,
"isEthConfirmed": true,
"unconfMsgs": {},
"messages": [],
"provider": {

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": true,
"isUnlocked": false,
"isEthConfirmed": true,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {},

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": true,
"isUnlocked": true,
"isEthConfirmed": true,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {
@ -403,4 +402,4 @@
"warning": null
},
"identities": {}
}
}

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": false,
"isUnlocked": false,
"isEthConfirmed": false,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {},
@ -36,4 +35,4 @@
"warning": null
},
"identities": {}
}
}

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": true,
"isUnlocked": true,
"isEthConfirmed": false,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {
@ -73,4 +72,4 @@
"detailView": {}
},
"identities": {}
}
}

@ -2,7 +2,6 @@
"metamask": {
"isInitialized": true,
"isUnlocked": true,
"isEthConfirmed": true,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {
@ -345,4 +344,4 @@
"isSubLoading": false
},
"identities": {}
}
}

@ -1,35 +0,0 @@
{
"metamask": {
"isInitialized": false,
"isUnlocked": false,
"currentDomain": "example.com",
"rpcTarget": "https://rawtestrpc.metamask.io/",
"identities": {},
"unconfTxs": {},
"accounts": {},
"transactions": [],
"network": "2",
"seedWords": null,
"isConfirmed": false,
"isEthConfirmed": false,
"unconfMsgs": {},
"messages": [],
"provider": {
"type": "testnet"
}
},
"appState": {
"menuOpen": false,
"currentView": {
"name": "EthStoreWarning"
},
"accountDetail": {
"subview": "transactions"
},
"currentDomain": "127.0.0.1:9966",
"transForward": true,
"isLoading": false,
"warning": null
},
"identities": {}
}

@ -5,7 +5,7 @@ QUnit.test('agree to terms', function (assert) {
var app = $('iframe').contents().find('#app-content .mock-app-root')
app.find('.markdown').prop('scrollTop', 100000000)
debugger;
wait().then(function() {
app.find('button').click()
}).then(function() {
@ -22,4 +22,3 @@ QUnit.test('agree to terms', function (assert) {
// Wait for view to transition:
})

@ -30,7 +30,6 @@ function mapStateToProps (state) {
network: state.metamask.network,
unconfTxs: valuesFor(state.metamask.unconfTxs),
unconfMsgs: valuesFor(state.metamask.unconfMsgs),
isEthWarningConfirmed: state.metamask.isEthConfirmed,
shapeShiftTxList: state.metamask.shapeShiftTxList,
}
}

@ -61,10 +61,6 @@ var actions = {
showPrivateKey: showPrivateKey,
SAVE_ACCOUNT_LABEL: 'SAVE_ACCOUNT_LABEL',
saveAccountLabel: saveAccountLabel,
AGREE_TO_ETH_WARNING: 'AGREE_TO_ETH_WARNING',
agreeToEthWarning: agreeToEthWarning,
SHOW_ETH_WARNING: 'SHOW_ETH_WARNING',
showEthWarning: showEthWarning,
// tx conf screen
COMPLETED_TX: 'COMPLETED_TX',
TRANSACTION_ERROR: 'TRANSACTION_ERROR',
@ -596,25 +592,6 @@ function showSendPage () {
}
}
function agreeToEthWarning () {
return (dispatch) => {
background.agreeToEthWarning((err) => {
if (err) {
return dispatch(actions.showEthWarning(err.message))
}
dispatch({
type: actions.AGREE_TO_ETH_WARNING,
})
})
}
}
function showEthWarning () {
return {
type: actions.SHOW_ETH_WARNING,
}
}
function buyEth (address, amount) {
return (dispatch) => {
background.buyEth(address, amount)

@ -25,7 +25,6 @@ const MenuDroppo = require('menu-droppo')
const DropMenuItem = require('./components/drop-menu-item')
const NetworkIndicator = require('./components/network')
const Tooltip = require('./components/tooltip')
const EthStoreWarning = require('./eth-store-warning')
const BuyView = require('./components/buy-button-subview')
const QrView = require('./components/qr-code')
module.exports = connect(mapStateToProps)(App)
@ -38,7 +37,6 @@ function mapStateToProps (state) {
// state from plugin
isLoading: state.appState.isLoading,
isConfirmed: state.metamask.isConfirmed,
isEthConfirmed: state.metamask.isEthConfirmed,
isInitialized: state.metamask.isInitialized,
isUnlocked: state.metamask.isUnlocked,
currentView: state.appState.currentView,
@ -421,9 +419,6 @@ App.prototype.renderPrimary = function () {
// show current view
switch (props.currentView.name) {
case 'EthStoreWarning':
return h(EthStoreWarning, {key: 'ethWarning'})
case 'accounts':
return h(AccountsScreen, {key: 'accounts'})

@ -1,89 +0,0 @@
const connect = require('react-redux').connect
const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const actions = require('./actions')
module.exports = connect(mapStateToProps)(EthStoreWarning)
inherits(EthStoreWarning, Component)
function EthStoreWarning () {
Component.call(this)
}
function mapStateToProps (state) {
return {
selectedAccount: state.metamask.selectedAccount,
}
}
EthStoreWarning.prototype.render = function () {
return (
h('.flex-column', {
key: 'ethWarning',
style: {
paddingTop: '25px',
marginRight: '30px',
marginLeft: '30px',
alignItems: 'center',
},
}, [
h('.warning', {
style: {
margin: '10px 10px 10px 10px',
},
},
`MetaMask is currently in beta; use
caution in storing large
amounts of ether.
`),
h('i.fa.fa-exclamation-triangle.fa-4', {
style: {
fontSize: '152px',
color: '#AEAEAE',
textAlign: 'center',
},
}),
h('.flex-row', {
style: {
marginTop: '25px',
marginBottom: '10px',
},
}, [
h('input', {
type: 'checkbox',
onChange: this.toggleShowWarning.bind(this),
}),
h('.warning', {
style: {
fontSize: '11px',
},
}, 'Don\'t show me this message again'),
]),
h('.flex-row', {
style: {
width: '100%',
justifyContent: 'space-around',
},
}, [
h('button', {
onClick: this.toAccounts.bind(this),
},
'Continue to MetaMask'),
]),
])
)
}
EthStoreWarning.prototype.toggleShowWarning = function () {
this.props.dispatch(actions.agreeToEthWarning())
}
EthStoreWarning.prototype.toAccounts = function () {
this.props.dispatch(actions.showAccountDetail(this.props.account))
}

@ -29,13 +29,10 @@ function reduceApp (state, action) {
name: 'createVaultComplete',
seedWords,
}
var ethStoreWarning = {
name: 'EthStoreWarning',
}
var appState = extend({
menuOpen: false,
currentView: seedWords ? seedConfView : !state.metamask.isEthConfirmed ? ethStoreWarning : defaultView,
currentView: seedWords ? seedConfView : defaultView,
accountDetail: {
subview: 'transactions',
},

@ -10,7 +10,6 @@ function reduceMetamask (state, action) {
var metamaskState = extend({
isInitialized: false,
isUnlocked: false,
isEthConfirmed: false,
rpcTarget: 'https://rawtestrpc.metamask.io/',
identities: {},
unconfTxs: {},
@ -34,11 +33,6 @@ function reduceMetamask (state, action) {
isConfirmed: true,
})
case actions.AGREE_TO_ETH_WARNING:
return extend(metamaskState, {
isEthConfirmed: !metamaskState.isEthConfirmed,
})
case actions.UNLOCK_METAMASK:
return extend(metamaskState, {
isUnlocked: true,

Loading…
Cancel
Save