From d4b65193c76cbaf2d5353f33a451dc5e1e5c663c Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Mon, 17 Aug 2020 13:53:52 +0200 Subject: [PATCH] Fix WebUI crash in edge case when media display size causes scroll Fixes #1406 --- app/javascript/flavours/glitch/components/media_gallery.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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(); } }