0
0
Fork 0

Fix pending upload count not being decremented on error (#12499)

The arguments were passed to the wrong function… also, there is no
need to have a conditional decrementation: failure to upload means
we marked an upload as pending, in all cases.
This commit is contained in:
ThibG 2019-11-29 17:02:18 +01:00 committed by Eugen Rochko
parent 07da35c17c
commit 667708f5b0
2 changed files with 3 additions and 4 deletions

View file

@ -328,7 +328,7 @@ export default function compose(state = initialState, action) {
case COMPOSE_UPLOAD_SUCCESS:
return appendMedia(state, fromJS(action.media), action.file);
case COMPOSE_UPLOAD_FAIL:
return state.set('is_uploading', false).update('pending_media_attachments', n => action.decrement ? n - 1 : n);
return state.set('is_uploading', false).update('pending_media_attachments', n => n - 1);
case COMPOSE_UPLOAD_UNDO:
return removeMedia(state, action.media_id);
case COMPOSE_UPLOAD_PROGRESS: