about summary refs log tree commit diff
diff options
context:
space:
mode:
authorりんすき <428rinsuki+git@gmail.com>2018-02-22 03:33:23 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-02-21 19:33:23 +0100
commitc1e77b56a92fc075f000af9c263c72ba6bdbe5f7 (patch)
tree2e9e77a1c3cb1059ea24f6f58b0d0ce980abb7da
parentf69d7cb43b3445d67a3549d87dd71dacf2b5be1e (diff)
fix #6523 (#6524)
-rw-r--r--app/javascript/mastodon/reducers/compose.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js
index c709fb88c..186134b1a 100644
--- a/app/javascript/mastodon/reducers/compose.js
+++ b/app/javascript/mastodon/reducers/compose.js
@@ -34,7 +34,7 @@ import uuid from '../uuid';
 import { me } from '../initial_state';
 
 const initialState = ImmutableMap({
-  mounted: false,
+  mounted: 0,
   sensitive: false,
   spoiler: false,
   spoiler_text: '',
@@ -159,10 +159,10 @@ 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)
+      .set('mounted', Math.max(state.get('mounted') - 1, 0))
       .set('is_composing', false);
   case COMPOSE_SENSITIVITY_CHANGE:
     return state.withMutations(map => {