Merge remote-tracking branch 'parent/main' into upstream-20240326

This commit is contained in:
KMY 2024-03-26 09:08:20 +09:00
commit 6c9b221cb2
263 changed files with 4628 additions and 1518 deletions

View file

@ -49,6 +49,7 @@ import {
INIT_MEDIA_EDIT_MODAL,
COMPOSE_CHANGE_MEDIA_DESCRIPTION,
COMPOSE_CHANGE_MEDIA_FOCUS,
COMPOSE_CHANGE_MEDIA_ORDER,
COMPOSE_SET_STATUS,
COMPOSE_SEARCHABILITY_CHANGE,
COMPOSE_FOCUS,
@ -655,6 +656,14 @@ export default function compose(state = initialState, action) {
return state.set('language', action.language);
case COMPOSE_FOCUS:
return state.set('focusDate', new Date()).update('text', text => text.length > 0 ? text : action.defaultText);
case COMPOSE_CHANGE_MEDIA_ORDER:
return state.update('media_attachments', list => {
const indexA = list.findIndex(x => x.get('id') === action.a);
const moveItem = list.get(indexA);
const indexB = list.findIndex(x => x.get('id') === action.b);
return list.splice(indexA, 1).splice(indexB, 0, moveItem);
});
default:
return state;
}

View file

@ -58,6 +58,7 @@ export const notificationToMap = notification => ImmutableMap({
list: notification.list ? ImmutableMap(notification.list) : null,
report: notification.report ? fromJS(notification.report) : null,
account_warning: notification.account_warning ? ImmutableMap(notification.account_warning) : null,
event: notification.event ? fromJS(notification.event) : null,
});
const normalizeNotification = (state, notification, usePendingItems) => {