mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Re-render jazzicon
component when diameter changes (#8114)
Previously when the `diameter` prop of the `jazzicon` component was changed, the new diameter would be ignored. The jazzicon is now redrawn upon each change, as you would expect. I don't think it's possible for this bug to manifest itself in the extension. This was discovered through tinkering with the Storybook for this component.
This commit is contained in:
parent
2be8bf0b0b
commit
cb995d66da
@ -28,10 +28,10 @@ export default class Jazzicon extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
const { address: prevAddress } = prevProps
|
const { address: prevAddress, diameter: prevDiameter } = prevProps
|
||||||
const { address } = this.props
|
const { address, diameter } = this.props
|
||||||
|
|
||||||
if (address !== prevAddress) {
|
if (address !== prevAddress || diameter !== prevDiameter) {
|
||||||
this.removeExistingChildren()
|
this.removeExistingChildren()
|
||||||
this.appendJazzicon()
|
this.appendJazzicon()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user