@ -20,6 +20,7 @@ import {
COMPOSE _SPOILERNESS _CHANGE ,
COMPOSE _SPOILERNESS _CHANGE ,
COMPOSE _SPOILER _TEXT _CHANGE ,
COMPOSE _SPOILER _TEXT _CHANGE ,
COMPOSE _VISIBILITY _CHANGE ,
COMPOSE _VISIBILITY _CHANGE ,
COMPOSE _COMPOSING _CHANGE ,
COMPOSE _EMOJI _INSERT ,
COMPOSE _EMOJI _INSERT ,
} from '../actions/compose' ;
} from '../actions/compose' ;
import { TIMELINE _DELETE } from '../actions/timelines' ;
import { TIMELINE _DELETE } from '../actions/timelines' ;
@ -37,6 +38,7 @@ const initialState = ImmutableMap({
focusDate : null ,
focusDate : null ,
preselectDate : null ,
preselectDate : null ,
in _reply _to : null ,
in _reply _to : null ,
is _composing : false ,
is _submitting : false ,
is _submitting : false ,
is _uploading : false ,
is _uploading : false ,
progress : 0 ,
progress : 0 ,
@ -146,7 +148,9 @@ export default function compose(state = initialState, action) {
case COMPOSE _MOUNT :
case COMPOSE _MOUNT :
return state . set ( 'mounted' , true ) ;
return state . set ( 'mounted' , true ) ;
case COMPOSE _UNMOUNT :
case COMPOSE _UNMOUNT :
return state . set ( 'mounted' , false ) ;
return state
. set ( 'mounted' , false )
. set ( 'is_composing' , false ) ;
case COMPOSE _SENSITIVITY _CHANGE :
case COMPOSE _SENSITIVITY _CHANGE :
return state
return state
. set ( 'sensitive' , ! state . get ( 'sensitive' ) )
. set ( 'sensitive' , ! state . get ( 'sensitive' ) )
@ -169,6 +173,8 @@ export default function compose(state = initialState, action) {
return state
return state
. set ( 'text' , action . text )
. set ( 'text' , action . text )
. set ( 'idempotencyKey' , uuid ( ) ) ;
. set ( 'idempotencyKey' , uuid ( ) ) ;
case COMPOSE _COMPOSING _CHANGE :
return state . set ( 'is_composing' , action . value ) ;
case COMPOSE _REPLY :
case COMPOSE _REPLY :
return state . withMutations ( map => {
return state . withMutations ( map => {
map . set ( 'in_reply_to' , action . status . get ( 'id' ) ) ;
map . set ( 'in_reply_to' , action . status . get ( 'id' ) ) ;