about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-08-17 13:53:52 +0200
committerStarfall <us@starfall.systems>2020-08-25 13:38:19 -0500
commitd2bd8f55902474253958aba38e2a09e3d24da14d (patch)
treefae32096a433e3fe814d9ee9284c0004aa868411
parentdc3a6bef97d212a27cc6019e8d3d6a18fd6da11c (diff)
Fix WebUI crash in edge case when media display size causes scroll
Fixes #1406
-rw-r--r--app/javascript/flavours/glitch/components/media_gallery.js6
1 files 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 3a4839414..96042f07a 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();
     }
   }