mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
fixing blockies display issues
This commit is contained in:
parent
1b89ceb63a
commit
bd48d858f4
@ -67,10 +67,11 @@ IdenticonComponent.prototype.componentDidMount = function () {
|
||||
// eslint-disable-next-line react/no-find-dom-node
|
||||
var container = findDOMNode(this)
|
||||
|
||||
const diameter = props.diameter || this.defaultDiameter
|
||||
|
||||
if (useBlockie) {
|
||||
_generateBlockie(container, address)
|
||||
} else {
|
||||
const diameter = props.diameter || this.defaultDiameter
|
||||
_generateJazzicon(container, address, diameter)
|
||||
}
|
||||
}
|
||||
@ -91,18 +92,21 @@ IdenticonComponent.prototype.componentDidUpdate = function () {
|
||||
container.removeChild(children[i])
|
||||
}
|
||||
|
||||
const diameter = props.diameter || this.defaultDiameter
|
||||
|
||||
if (useBlockie) {
|
||||
_generateBlockie(container, address)
|
||||
_generateBlockie(container, address, diameter)
|
||||
} else {
|
||||
const diameter = props.diameter || this.defaultDiameter
|
||||
_generateJazzicon(container, address, diameter)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _generateBlockie(container, address) {
|
||||
function _generateBlockie(container, address, diameter) {
|
||||
const img = new Image()
|
||||
img.src = toDataUrl(address)
|
||||
const dia = !diameter || diameter < 50 ? 50 : diameter
|
||||
img.height, img.width = dia * 1.25
|
||||
container.appendChild(img)
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ class Settings extends Component {
|
||||
|
||||
return h('div.settings__content-row', [
|
||||
h('div.settings__content-item', [
|
||||
h('span', 'Use Blockie Identicon'),
|
||||
h('span', 'Use Blockies Identicon'),
|
||||
]),
|
||||
h('div.settings__content-item', [
|
||||
h('div.settings__content-item-col', [
|
||||
|
Loading…
Reference in New Issue
Block a user