@ -51,6 +51,7 @@ const initialState = ImmutableMap({
in _reply _to : null ,
is _composing : false ,
is _submitting : false ,
is _changing _upload : false ,
is _uploading : false ,
progress : 0 ,
media _attachments : ImmutableList ( ) ,
@ -79,6 +80,7 @@ function clearAll(state) {
map . set ( 'spoiler' , false ) ;
map . set ( 'spoiler_text' , '' ) ;
map . set ( 'is_submitting' , false ) ;
map . set ( 'is_changing_upload' , false ) ;
map . set ( 'in_reply_to' , null ) ;
map . set ( 'privacy' , state . get ( 'default_privacy' ) ) ;
map . set ( 'sensitive' , false ) ;
@ -248,13 +250,15 @@ export default function compose(state = initialState, action) {
map . set ( 'idempotencyKey' , uuid ( ) ) ;
} ) ;
case COMPOSE _SUBMIT _REQUEST :
case COMPOSE _UPLOAD _CHANGE _REQUEST :
return state . set ( 'is_submitting' , true ) ;
case COMPOSE _UPLOAD _CHANGE _REQUEST :
return state . set ( 'is_changing_upload' , true ) ;
case COMPOSE _SUBMIT _SUCCESS :
return clearAll ( state ) ;
case COMPOSE _SUBMIT _FAIL :
case COMPOSE _UPLOAD _CHANGE _FAIL :
return state . set ( 'is_submitting' , false ) ;
case COMPOSE _UPLOAD _CHANGE _FAIL :
return state . set ( 'is_changing_upload' , false ) ;
case COMPOSE _UPLOAD _REQUEST :
return state . set ( 'is_uploading' , true ) ;
case COMPOSE _UPLOAD _SUCCESS :
@ -300,7 +304,7 @@ export default function compose(state = initialState, action) {
return insertEmoji ( state , action . position , action . emoji , action . needsSpace ) ;
case COMPOSE _UPLOAD _CHANGE _SUCCESS :
return state
. set ( 'is_submitting ' , false )
. set ( 'is_changing_upload ' , false )
. update ( 'media_attachments' , list => list . map ( item => {
if ( item . get ( 'id' ) === action . media . id ) {
return fromJS ( action . media ) ;