about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-07-13 15:45:21 +0200
committerGitHub <noreply@github.com>2021-07-13 15:45:21 +0200
commit82bc8e764798b74f475763136117592526d905fa (patch)
treef4d08fae970df4476065f04fe33d3e1aab266660 /app/javascript/flavours/glitch/features/ui/components
parentddf3f4cf85f0be6f221e68bda5944dd8a034ff91 (diff)
parente4270cb55a133f4cb93290ff88b3fd2a3aa9f536 (diff)
Merge pull request #1566 from ClearlyClaire/glitch-soc/feature/modal-stack
Fix boost/fav confirmation modals closing media modal
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/modal_root.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
index 0fd70de34..2636e79f5 100644
--- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js
+++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js
@@ -59,12 +59,8 @@ export default class ModalRoot extends React.PureComponent {
     backgroundColor: null,
   };
 
-  getSnapshotBeforeUpdate () {
-    return { visible: !!this.props.type };
-  }
-
-  componentDidUpdate (prevProps, prevState, { visible }) {
-    if (visible) {
+  componentDidUpdate () {
+    if (!!this.props.type) {
       document.body.classList.add('with-modals--active');
       document.documentElement.style.marginRight = `${getScrollbarWidth()}px`;
     } else {