]> cat aescling's git repositories - mastodon.git/commitdiff
Fix WebUI crash in edge case when media display size causes scroll
authorThibaut Girka <thib@sitedethib.com>
Mon, 17 Aug 2020 11:53:52 +0000 (13:53 +0200)
committerThibG <thib@sitedethib.com>
Mon, 17 Aug 2020 13:46:18 +0000 (15:46 +0200)
Fixes #1406

app/javascript/flavours/glitch/components/media_gallery.js

index 3a48394140b50cd29f3db2444488910b1123b289..96042f07a93b9c434eeef37a7502c7623f71dd74 100644 (file)
@@ -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();
     }
   }