pl-fe: fix media attachments reorder
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
5a60869a02
commit
4a9837854b
1 changed files with 2 additions and 2 deletions
|
@ -658,10 +658,10 @@ const compose = (state = initialState, action: ComposeAction | EventsAction | In
|
|||
case COMPOSE_CHANGE_MEDIA_ORDER:
|
||||
return updateCompose(state, action.composeId, compose => {
|
||||
const indexA = compose.media_attachments.findIndex(x => x.id === action.a);
|
||||
const moveItem = compose.media_attachments[indexA];
|
||||
const indexB = compose.media_attachments.findIndex(x => x.id === action.b);
|
||||
|
||||
compose.media_attachments = compose.media_attachments.splice(indexA, 1).splice(indexB, 0, moveItem);
|
||||
const item = compose.media_attachments.splice(indexA, 1)[0];
|
||||
compose.media_attachments.splice(indexB, 0, item);
|
||||
});
|
||||
case COMPOSE_ADD_SUGGESTED_QUOTE:
|
||||
return updateCompose(state, action.composeId, compose => {
|
||||
|
|
Loading…
Reference in a new issue