From cb995d66da8ef1c37dc271cc19ca52629f2fef96 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 26 Feb 2020 09:42:33 -0400 Subject: [PATCH] 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. --- ui/app/components/ui/jazzicon/jazzicon.component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/app/components/ui/jazzicon/jazzicon.component.js b/ui/app/components/ui/jazzicon/jazzicon.component.js index 24fb9f61e..81c5c540a 100644 --- a/ui/app/components/ui/jazzicon/jazzicon.component.js +++ b/ui/app/components/ui/jazzicon/jazzicon.component.js @@ -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() }