aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/identicon.js
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-11-18 06:27:34 +0800
committerGitHub <noreply@github.com>2016-11-18 06:27:34 +0800
commit6400eb8453c173e04e59d7990bd2c79afb3493be (patch)
treeecb311d43d0f77d5f5f0e82a0014a09c6381f0ef /ui/app/components/identicon.js
parent115fdc36fefd33e4bf4a9e551dd6267d3d75f2c5 (diff)
parent4352c7031afb6f9a175b29d0addeb7ea48345676 (diff)
downloadtangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.gz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.bz2
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.lz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.xz
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.tar.zst
tangerine-wallet-browser-6400eb8453c173e04e59d7990bd2c79afb3493be.zip
Merge pull request #816 from MetaMask/i328-MultiVault
Multi vault to Dev Branch
Diffstat (limited to 'ui/app/components/identicon.js')
-rw-r--r--ui/app/components/identicon.js30
1 files changed, 23 insertions, 7 deletions
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js
index 4b2bf899e..6d4871d02 100644
--- a/ui/app/components/identicon.js
+++ b/ui/app/components/identicon.js
@@ -16,8 +16,8 @@ function IdenticonComponent () {
}
IdenticonComponent.prototype.render = function () {
- var state = this.props
- var diameter = state.diameter || this.defaultDiameter
+ var props = this.props
+ var diameter = props.diameter || this.defaultDiameter
return (
h('div', {
key: 'identicon-' + this.props.address,
@@ -33,15 +33,31 @@ IdenticonComponent.prototype.render = function () {
}
IdenticonComponent.prototype.componentDidMount = function () {
- var state = this.props
- var address = state.address
+ var props = this.props
+ var address = props.address
if (!address) return
var container = findDOMNode(this)
- var diameter = state.diameter || this.defaultDiameter
- var imageify = state.imageify === undefined ? true : state.imageify
- var img = iconFactory.iconForAddress(address, diameter, imageify)
+ var diameter = props.diameter || this.defaultDiameter
+ var img = iconFactory.iconForAddress(address, diameter, false)
container.appendChild(img)
}
+IdenticonComponent.prototype.componentDidUpdate = function () {
+ var props = this.props
+ var address = props.address
+
+ if (!address) return
+
+ var container = findDOMNode(this)
+
+ var children = container.children
+ for (var i = 0; i < children.length; i++) {
+ container.removeChild(children[i])
+ }
+
+ var diameter = props.diameter || this.defaultDiameter
+ var img = iconFactory.iconForAddress(address, diameter, false)
+ container.appendChild(img)
+}