From 7cc78431092edb0996372bc93bbc398a34af2395 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 6 Oct 2018 18:53:49 +0200 Subject: Do not scroll timelines when *closing* media modals Media modals push an history state so that pressing back on mobile closes them. We made sure to not scroll when opening them, but not when *closing* them, which caused some issues in rare cases. --- app/javascript/flavours/glitch/features/reblogs/index.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch/features/reblogs') diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index c0a65d1de..75f8390a1 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -34,6 +34,7 @@ export default class Reblogs extends ImmutablePureComponent { } shouldUpdateScroll = (prevRouterProps, { location }) => { + if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false; return !(location.state && location.state.mastodonModalOpen); } -- cgit