Skip to content

Commit 2cdd301

Browse files
committed
emoji: Cut out disused INIT_REALM_EMOJI action type.
This hasn't been used since 155df74, in 2017. Instead, we get this data on `register`. Which is a good thing, too, because getting it this way would be inherently racy. That's the problem `register` solves.
1 parent 9b6f6fb commit 2cdd301

File tree

4 files changed

+3
-28
lines changed

4 files changed

+3
-28
lines changed

src/actionConstants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const INITIAL_FETCH_START: 'INITIAL_FETCH_START' = 'INITIAL_FETCH_START';
2323
export const INITIAL_FETCH_COMPLETE: 'INITIAL_FETCH_COMPLETE' = 'INITIAL_FETCH_COMPLETE';
2424
export const INIT_STREAMS: 'INIT_STREAMS' = 'INIT_STREAMS';
2525
export const INIT_SUBSCRIPTIONS: 'INIT_SUBSCRIPTIONS' = 'INIT_SUBSCRIPTIONS';
26-
export const INIT_REALM_EMOJI: 'INIT_REALM_EMOJI' = 'INIT_REALM_EMOJI';
2726
export const INIT_REALM_FILTER: 'INIT_REALM_FILTER' = 'INIT_REALM_FILTER';
2827
export const INIT_TOPICS: 'INIT_TOPICS' = 'INIT_TOPICS';
2928

src/actionTypes.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
MESSAGE_FETCH_COMPLETE,
2525
INITIAL_FETCH_START,
2626
INITIAL_FETCH_COMPLETE,
27-
INIT_REALM_EMOJI,
2827
INIT_REALM_FILTER,
2928
SETTINGS_CHANGE,
3029
DRAFT_UPDATE,
@@ -520,11 +519,6 @@ export type EventAction =
520519
| {| type: 'ignore' |}
521520
| {| type: 'unknown', event: {} |};
522521

523-
type InitRealmEmojiAction = {|
524-
type: typeof INIT_REALM_EMOJI,
525-
emojis: RealmEmojiById,
526-
|};
527-
528522
type InitRealmFilterAction = {|
529523
type: typeof INIT_REALM_FILTER,
530524
filters: RealmFilter[],
@@ -614,7 +608,6 @@ type RealmAction =
614608
| RealmInitAction
615609
| UnackPushTokenAction
616610
| AckPushTokenAction
617-
| InitRealmEmojiAction
618611
| InitRealmFilterAction;
619612

620613
type SessionAction =

src/realm/realmActions.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
/* @flow strict-local */
2-
import type { Auth, Dispatch, RealmFilter, InitialData, RealmEmojiById, Action } from '../types';
3-
import { getRealmEmojis, getRealmFilters } from '../api';
4-
import { REALM_INIT, INIT_REALM_EMOJI, INIT_REALM_FILTER } from '../actionConstants';
2+
import type { Auth, Dispatch, RealmFilter, InitialData, Action } from '../types';
3+
import { getRealmFilters } from '../api';
4+
import { REALM_INIT, INIT_REALM_FILTER } from '../actionConstants';
55

66
export const realmInit = (data: InitialData): Action => ({
77
type: REALM_INIT,
88
data,
99
});
1010

11-
export const initRealmEmojis = (emojis: RealmEmojiById): Action => ({
12-
type: INIT_REALM_EMOJI,
13-
emojis,
14-
});
15-
16-
export const fetchRealmEmojis = (auth: Auth) => async (dispatch: Dispatch) => {
17-
const { emoji } = await getRealmEmojis(auth);
18-
dispatch(initRealmEmojis(emoji));
19-
};
20-
2111
export const initRealmFilters = (filters: RealmFilter[]): Action => ({
2212
type: INIT_REALM_FILTER,
2313
filters,

src/realm/realmReducers.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
LOGOUT,
77
LOGIN_SUCCESS,
88
ACCOUNT_SWITCH,
9-
INIT_REALM_EMOJI,
109
EVENT_UPDATE_DISPLAY_SETTINGS,
1110
INIT_REALM_FILTER,
1211
EVENT_REALM_FILTERS,
@@ -47,12 +46,6 @@ export default (state: RealmState = initialState, action: Action): RealmState =>
4746
emoji: {},
4847
};
4948

50-
case INIT_REALM_EMOJI:
51-
return {
52-
...state,
53-
emoji: action.emojis,
54-
};
55-
5649
case INIT_REALM_FILTER:
5750
return {
5851
...state,

0 commit comments

Comments
 (0)