diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 3a48394140..96042f07a9 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -287,10 +287,8 @@ class MediaGallery extends React.PureComponent { } componentDidUpdate (prevProps) { - if (this.node && this.node.offsetWidth && this.node.offsetWidth != this.state.width) { - this.setState({ - width: this.node.offsetWidth, - }); + if (this.node) { + this.handleResize(); } }