From 2775132b00f5f38252066aca37ef380a490402f7 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(); } }