Convert disconnectTimeline and timelineDelete actions to Typescript (#30777)

This commit is contained in:
Renaud Chaput 2024-06-20 13:56:52 +02:00 committed by GitHub
parent 27529247b2
commit 1c65932776
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 65 additions and 49 deletions

View file

@ -1,5 +1,7 @@
import { Map as ImmutableMap, fromJS } from 'immutable';
import { timelineDelete } from 'mastodon/actions/timelines_typed';
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
import { normalizeStatusTranslation } from '../actions/importer/normalizer';
import {
@ -27,7 +29,6 @@ import {
STATUS_FETCH_REQUEST,
STATUS_FETCH_FAIL,
} from '../actions/statuses';
import { TIMELINE_DELETE } from '../actions/timelines';
const importStatus = (state, status) => state.set(status.id, fromJS(status));
@ -114,8 +115,8 @@ export default function statuses(state = initialState, action) {
});
case STATUS_COLLAPSE:
return state.setIn([action.id, 'collapsed'], action.isCollapsed);
case TIMELINE_DELETE:
return deleteStatus(state, action.id, action.references);
case timelineDelete.type:
return deleteStatus(state, action.payload.statusId, action.payload.references);
case STATUS_TRANSLATE_SUCCESS:
return statusTranslateSuccess(state, action.id, action.translation);
case STATUS_TRANSLATE_UNDO: