mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-14 00:08:46 +00:00
[Glitch] Convert disconnectTimeline and timelineDelete actions to Typescript
Port 1c65932776 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable';
|
||||
|
||||
import { timelineDelete } from 'flavours/glitch/actions/timelines_typed';
|
||||
|
||||
import {
|
||||
COMPOSE_MOUNT,
|
||||
COMPOSE_UNMOUNT,
|
||||
@@ -54,7 +56,6 @@ import {
|
||||
} from '../actions/compose';
|
||||
import { REDRAFT } from '../actions/statuses';
|
||||
import { STORE_HYDRATE } from '../actions/store';
|
||||
import { TIMELINE_DELETE } from '../actions/timelines';
|
||||
import { me, defaultContentType } from '../initial_state';
|
||||
import { recoverHashtags } from '../utils/hashtag';
|
||||
import { unescapeHTML } from '../utils/html';
|
||||
@@ -551,10 +552,10 @@ export default function compose(state = initialState, action) {
|
||||
return updateSuggestionTags(state, action.token);
|
||||
case COMPOSE_TAG_HISTORY_UPDATE:
|
||||
return state.set('tagHistory', fromJS(action.tags));
|
||||
case TIMELINE_DELETE:
|
||||
if (action.id === state.get('in_reply_to')) {
|
||||
case timelineDelete.type:
|
||||
if (action.payload.statusId === state.get('in_reply_to')) {
|
||||
return state.set('in_reply_to', null);
|
||||
} else if (action.id === state.get('id')) {
|
||||
} else if (action.payload.statusId === state.get('id')) {
|
||||
return state.set('id', null);
|
||||
} else {
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user