aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/identicon.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-02 08:04:36 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-02 08:06:18 +0800
commitf2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7 (patch)
tree4e5ae6f0d4664ee92d5dfeb4d08f661931692adc /ui/app/components/identicon.js
parentb5f6ef8c013f2f742546a04e148bac99fbc4691c (diff)
downloadtangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar.gz
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar.bz2
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar.lz
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar.xz
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.tar.zst
tangerine-wallet-browser-f2bfdd7f8ca4d79b3143f39a7bec3b585d9c74b7.zip
Make identicon tolerant of changing state
Diffstat (limited to 'ui/app/components/identicon.js')
-rw-r--r--ui/app/components/identicon.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js
index 30ef6fbd3..6d4871d02 100644
--- a/ui/app/components/identicon.js
+++ b/ui/app/components/identicon.js
@@ -44,3 +44,20 @@ IdenticonComponent.prototype.componentDidMount = function () {
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)
+}