1
0
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:
Mark Stacey 2020-02-26 09:42:33 -04:00 committed by GitHub
parent 2be8bf0b0b
commit cb995d66da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,10 +28,10 @@ export default class Jazzicon extends PureComponent {
}
componentDidUpdate (prevProps) {
const { address: prevAddress } = prevProps
const { address } = this.props
const { address: prevAddress, diameter: prevDiameter } = prevProps
const { address, diameter } = this.props
if (address !== prevAddress) {
if (address !== prevAddress || diameter !== prevDiameter) {
this.removeExistingChildren()
this.appendJazzicon()
}