about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/follow_requests/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-10-06 18:53:49 +0200
committerThibG <thib@sitedethib.com>2018-10-07 12:08:32 +0200
commit7cc78431092edb0996372bc93bbc398a34af2395 (patch)
tree461f4e9ae1fc6cdc3765e205477d252d6e6e77f9 /app/javascript/flavours/glitch/features/follow_requests/index.js
parentf990b9c76828c791e86d58e02bf6eadf80c88ce5 (diff)
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.
Diffstat (limited to 'app/javascript/flavours/glitch/features/follow_requests/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/follow_requests/index.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.js b/app/javascript/flavours/glitch/features/follow_requests/index.js
index 1e4633984..bce6338ea 100644
--- a/app/javascript/flavours/glitch/features/follow_requests/index.js
+++ b/app/javascript/flavours/glitch/features/follow_requests/index.js
@@ -43,6 +43,7 @@ export default class FollowRequests extends ImmutablePureComponent {
   }
 
   shouldUpdateScroll = (prevRouterProps, { location }) => {
+    if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;
     return !(location.state && location.state.mastodonModalOpen);
   }