aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-11 01:34:13 +0800
committerKevin Serrano <kevgagser@gmail.com>2017-03-11 01:34:13 +0800
commit2ab86b001dfc4ade4fc6df030175e64359b757e6 (patch)
treedd552767149226c535f48be7de6365ffd55dee8e /ui/app
parentb34ee4daa145c1d4eea2da6fd0cba0763e5c6483 (diff)
downloadtangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar.gz
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar.bz2
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar.lz
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar.xz
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.tar.zst
tangerine-wallet-browser-2ab86b001dfc4ade4fc6df030175e64359b757e6.zip
Add comments.
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/actions.js1
-rw-r--r--ui/app/components/ens-input.js5
2 files changed, 6 insertions, 0 deletions
diff --git a/ui/app/actions.js b/ui/app/actions.js
index e21b6257d..4e0435ade 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -698,6 +698,7 @@ function setRpcTarget (newRpc) {
}
}
+// Calls the addressBookController to add a new address.
function addToAddressBook (recipient, nickname) {
log.debug(`background.addToAddressBook`)
return (dispatch) => {
diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js
index 06efe6652..d5348ea62 100644
--- a/ui/app/components/ens-input.js
+++ b/ui/app/components/ens-input.js
@@ -47,11 +47,13 @@ EnsInput.prototype.render = function () {
style: { width: '100%' },
}, [
h('input.large-input', opts),
+ // The address book functionality.
h('datalist',
{
id: 'addresses',
},
[
+ // Corresponds to the addresses owned.
Object.keys(props.identities).map((key) => {
let identity = props.identities[key]
return h('option', {
@@ -59,6 +61,7 @@ EnsInput.prototype.render = function () {
label: identity.name,
})
}),
+ // Corresponds to previously sent-to addresses.
props.addressBook.map((identity) => {
return h('option', {
value: identity.address,
@@ -118,6 +121,8 @@ EnsInput.prototype.lookupEnsName = function () {
EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) {
const state = this.state || {}
const ensResolution = state.ensResolution
+ // If an address is sent without a nickname, meaning not from ENS or from
+ // the user's own accounts, a default of a one-space string is used.
const nickname = state.nickname || ' '
if (ensResolution && this.props.onChange &&
ensResolution !== prevState.ensResolution) {