Switch to compose route when replying and compose is not mounted

This commit is contained in:
Eugen Rochko 2016-11-21 10:52:11 +01:00
parent 93577f74e7
commit d32e0364f9
6 changed files with 56 additions and 14 deletions

View file

@ -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: