From 6f316ca450967c161e7f231127a76494bace40a8 Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 30 Apr 2018 16:36:17 -0700 Subject: network - remove setNetworkEndpoints --- old-ui/app/app.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'old-ui/app') diff --git a/old-ui/app/app.js b/old-ui/app/app.js index 3aa845b3a..fe5e57d93 100644 --- a/old-ui/app/app.js +++ b/old-ui/app/app.js @@ -409,7 +409,6 @@ App.prototype.renderDropdown = function () { closeMenu: () => this.setState({ isMainMenuOpen: !isOpen }), onClick: () => { this.props.dispatch(actions.setFeatureFlag('betaUI', true, 'BETA_UI_NOTIFICATION_MODAL')) - .then(() => this.props.dispatch(actions.setNetworkEndpoints(BETA_UI_NETWORK_TYPE))) }, }, 'Try Beta!'), ]) @@ -472,7 +471,6 @@ App.prototype.renderPrimary = function () { onClick: () => { global.platform.openExtensionInBrowser() props.dispatch(actions.setFeatureFlag('betaUI', true, 'BETA_UI_NOTIFICATION_MODAL')) - .then(() => props.dispatch(actions.setNetworkEndpoints(BETA_UI_NETWORK_TYPE))) }, style: { fontSize: '0.8em', -- cgit From a1d13d45cf7451162b071e5507f1e31b12574e6e Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 2 May 2018 18:23:55 -0700 Subject: lint - cleanup some unused variables --- old-ui/app/app.js | 1 - 1 file changed, 1 deletion(-) (limited to 'old-ui/app') diff --git a/old-ui/app/app.js b/old-ui/app/app.js index fe5e57d93..2378a1a0a 100644 --- a/old-ui/app/app.js +++ b/old-ui/app/app.js @@ -35,7 +35,6 @@ const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete') const HDRestoreVaultScreen = require('./keychains/hd/restore-vault') const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation') const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns -const { BETA_UI_NETWORK_TYPE } = require('../../app/scripts/controllers/network/enums') module.exports = connect(mapStateToProps)(App) -- cgit From 924cc1fcf7de1896ac09bbe7a400d5ff5df0b50d Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Thu, 19 Apr 2018 01:03:51 -0230 Subject: Move setAccountLabel into PreferencesController --- old-ui/app/account-detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'old-ui/app') diff --git a/old-ui/app/account-detail.js b/old-ui/app/account-detail.js index 692d50491..c67f0cf71 100644 --- a/old-ui/app/account-detail.js +++ b/old-ui/app/account-detail.js @@ -91,7 +91,7 @@ AccountDetailScreen.prototype.render = function () { isEditingLabel: false, }, saveText: (text) => { - props.dispatch(actions.saveAccountLabel(selected, text)) + props.dispatch(actions.setAccountLabel(selected, text)) }, }, [ -- cgit From 5d8dd1df0e6ab603aed66a94c0f62ae36273e79c Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 21 May 2018 17:29:03 -0700 Subject: old-ui - ens-input - fix params passed to input --- old-ui/app/components/ens-input.js | 101 +++++++++++++++++++------------------ 1 file changed, 53 insertions(+), 48 deletions(-) (limited to 'old-ui/app') diff --git a/old-ui/app/components/ens-input.js b/old-ui/app/components/ens-input.js index d09c30644..7e06fa9f1 100644 --- a/old-ui/app/components/ens-input.js +++ b/old-ui/app/components/ens-input.js @@ -1,7 +1,6 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits -const extend = require('xtend') const debounce = require('debounce') const copyToClipboard = require('copy-to-clipboard') const ENS = require('ethjs-ens') @@ -20,55 +19,61 @@ function EnsInput () { EnsInput.prototype.render = function () { const props = this.props - const opts = extend(props, { - list: 'addresses', - onChange: () => { - const network = this.props.network - const networkHasEnsSupport = getNetworkEnsSupport(network) - if (!networkHasEnsSupport) return - - const recipient = document.querySelector('input[name="address"]').value - if (recipient.match(ensRE) === null) { - return this.setState({ - loadingEns: false, - ensResolution: null, - ensFailure: null, - }) - } - this.setState({ - loadingEns: true, + function onInputChange() { + const network = this.props.network + const networkHasEnsSupport = getNetworkEnsSupport(network) + if (!networkHasEnsSupport) return + + const recipient = document.querySelector('input[name="address"]').value + if (recipient.match(ensRE) === null) { + return this.setState({ + loadingEns: false, + ensResolution: null, + ensFailure: null, }) - this.checkName() - }, - }) - return h('div', { - style: { width: '100%' }, - }, [ - h('input.large-input', opts), - // The address book functionality. - h('datalist#addresses', - [ - // Corresponds to the addresses owned. - Object.keys(props.identities).map((key) => { - const identity = props.identities[key] - return h('option', { - value: identity.address, - label: identity.name, - key: identity.address, - }) - }), - // Corresponds to previously sent-to addresses. - props.addressBook.map((identity) => { - return h('option', { - value: identity.address, - label: identity.name, - key: identity.address, - }) - }), - ]), - this.ensIcon(), - ]) + } + + this.setState({ + loadingEns: true, + }) + this.checkName() + } + + return ( + h('div', { + style: { width: '100%' }, + }, [ + h('input.large-input', { + name: props.name, + placeholder: props.placeholder, + list: 'addresses', + onChange: onInputChange.bind(this), + }), + // The address book functionality. + h('datalist#addresses', + [ + // Corresponds to the addresses owned. + Object.keys(props.identities).map((key) => { + const identity = props.identities[key] + return h('option', { + value: identity.address, + label: identity.name, + key: identity.address, + }) + }), + // Corresponds to previously sent-to addresses. + props.addressBook.map((identity) => { + return h('option', { + value: identity.address, + label: identity.name, + key: identity.address, + }) + }), + ]), + this.ensIcon(), + ]) + ) } EnsInput.prototype.componentDidMount = function () { -- cgit From 0b84ceae6831638ea98584a7262287a2d6ec1a8e Mon Sep 17 00:00:00 2001 From: kumavis Date: Mon, 21 May 2018 17:58:48 -0700 Subject: old-ui - app - use state.metamask.selectedAddress instead of currentView.context --- old-ui/app/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'old-ui/app') diff --git a/old-ui/app/app.js b/old-ui/app/app.js index 2378a1a0a..abeb4f3f9 100644 --- a/old-ui/app/app.js +++ b/old-ui/app/app.js @@ -62,7 +62,7 @@ function mapStateToProps (state) { isInitialized: state.metamask.isInitialized, isUnlocked: state.metamask.isUnlocked, currentView: state.appState.currentView, - activeAddress: state.appState.activeAddress, + selectedAddress: state.metamask.selectedAddress, transForward: state.appState.transForward, isMascara: state.metamask.isMascara, isOnboarding: Boolean(!noActiveNotices || seedWords || !isInitialized), @@ -197,7 +197,7 @@ App.prototype.renderAppBar = function () { style: {}, enableAccountsSelector: true, identities: this.props.identities, - selected: this.props.currentView.context, + selected: this.props.selectedAddress, network: this.props.network, keyrings: this.props.keyrings, }, []), @@ -588,7 +588,7 @@ App.prototype.renderPrimary = function () { }, }, [ h('i.fa.fa-arrow-left.fa-lg.cursor-pointer.color-orange', { - onClick: () => props.dispatch(actions.backToAccountDetail(props.activeAddress)), + onClick: () => props.dispatch(actions.backToAccountDetail(props.selectedAddress)), style: { marginLeft: '10px', marginTop: '50px', -- cgit