about summary refs log tree commit diff
path: root/app/assets/javascripts/components/reducers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-21 10:52:11 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-21 10:52:11 +0100
commitd32e0364f9aa2d61080c53489996351d4bd7b1c4 (patch)
treeb30efea75acedb9a7fdf54727c2a54066f976c6d /app/assets/javascripts/components/reducers
parent93577f74e7ec2edee3a1a208513ae7290211e682 (diff)
Switch to compose route when replying and compose is not mounted
Diffstat (limited to 'app/assets/javascripts/components/reducers')
-rw-r--r--app/assets/javascripts/components/reducers/compose.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/reducers/compose.jsx b/app/assets/javascripts/components/reducers/compose.jsx
index 3adff36a3..e6e86d4f5 100644
--- a/app/assets/javascripts/components/reducers/compose.jsx
+++ b/app/assets/javascripts/components/reducers/compose.jsx
@@ -1,4 +1,6 @@
 import {
+  COMPOSE_MOUNT,
+  COMPOSE_UNMOUNT,
   COMPOSE_CHANGE,
   COMPOSE_REPLY,
   COMPOSE_REPLY_CANCEL,
@@ -20,6 +22,7 @@ import { ACCOUNT_SET_SELF } from '../actions/accounts';
 import Immutable from 'immutable';
 
 const initialState = Immutable.Map({
+  mounted: false,
   text: '',
   in_reply_to: null,
   is_submitting: false,
@@ -80,6 +83,10 @@ const insertSuggestion = (state, position, completion) => {
 
 export default function compose(state = initialState, action) {
   switch(action.type) {
+    case COMPOSE_MOUNT:
+      return state.set('mounted', true);
+    case COMPOSE_UNMOUNT:
+      return state.set('mounted', false);
     case COMPOSE_CHANGE:
       return state.set('text', action.text);
     case COMPOSE_REPLY: