about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/reducers
diff options
context:
space:
mode:
authorりんすき <428rinsuki+git@gmail.com>2018-02-22 03:33:23 +0900
committermultiple creatures <dev@multiple-creature.party>2019-11-19 13:43:44 -0600
commit58a63aef1f8800be5d81ea0de8ad49bc2980bf5e (patch)
tree84b63c79c950e299fd69aa1edb2c97abe6b7c5cb /app/javascript/flavours/glitch/reducers
parent74b18e0d26bb7ef4ed539c55a33be537a6335129 (diff)
[Glitch] Fix composer route opening when not needed
Port c1e77b56a92fc075f000af9c263c72ba6bdbe5f7 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/reducers')
-rw-r--r--app/javascript/flavours/glitch/reducers/compose.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js
index 43876e450..a40299e20 100644
--- a/app/javascript/flavours/glitch/reducers/compose.js
+++ b/app/javascript/flavours/glitch/reducers/compose.js
@@ -57,7 +57,7 @@ const totalElefriends = 3;
 const glitchProbability = 1 - 0.0420215528;
 
 const initialState = ImmutableMap({
-  mounted: false,
+  mounted: 0,
   advanced_options: ImmutableMap({
     do_not_federate: defaultLocal || alwaysLocal,
     threaded_mode: false,
@@ -280,9 +280,9 @@ export default function compose(state = initialState, action) {
   case STORE_HYDRATE:
     return hydrate(state, action.state.get('compose'));
   case COMPOSE_MOUNT:
-    return state.set('mounted', true);
+    return state.set('mounted', state.get('mounted') + 1);
   case COMPOSE_UNMOUNT:
-    return state.set('mounted', false);
+    return state.set('mounted', Math.max(state.get('mounted') - 1, 0));
   case COMPOSE_ADVANCED_OPTIONS_CHANGE:
     return state
       .set('advanced_options', state.get('advanced_options').set(action.option, !!overwrite(!state.getIn(['advanced_options', action.option]), action.value)))