From e1a6526c8dccec4464667b422cc2336b28504d2c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 27 Nov 2020 15:41:58 +0100 Subject: [PATCH] Fix media modal regression on public pages (#15221) --- .../mastodon/containers/media_container.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/containers/media_container.js b/app/javascript/mastodon/containers/media_container.js index ba55ecbc7b..afed6868e1 100644 --- a/app/javascript/mastodon/containers/media_container.js +++ b/app/javascript/mastodon/containers/media_container.js @@ -30,6 +30,7 @@ export default class MediaContainer extends PureComponent { media: null, index: null, time: null, + backgroundColor: null, }; handleOpenMedia = (media, index) => { @@ -52,7 +53,16 @@ export default class MediaContainer extends PureComponent { document.body.classList.remove('with-modals--active'); document.documentElement.style.marginRight = 0; - this.setState({ media: null, index: null, time: null }); + this.setState({ + media: null, + index: null, + time: null, + backgroundColor: null, + }); + } + + setBackgroundColor = color => { + this.setState({ backgroundColor: color }); } render () { @@ -85,13 +95,14 @@ export default class MediaContainer extends PureComponent { ); })} - + {this.state.media && ( )}