Remove unused code
This commit is contained in:
parent
b9dab37eac
commit
2292a61135
6 changed files with 5 additions and 87 deletions
|
@ -8,10 +8,6 @@ export const REACTION_DECK_UPDATE_REQUEST = 'REACTION_DECK_UPDATE_REQUEST';
|
|||
export const REACTION_DECK_UPDATE_SUCCESS = 'REACTION_DECK_UPDATE_SUCCESS';
|
||||
export const REACTION_DECK_UPDATE_FAIL = 'REACTION_DECK_UPDATE_FAIL';
|
||||
|
||||
export const REACTION_DECK_REMOVE_REQUEST = 'REACTION_DECK_REMOVE_REQUEST';
|
||||
export const REACTION_DECK_REMOVE_SUCCESS = 'REACTION_DECK_REMOVE_SUCCESS';
|
||||
export const REACTION_DECK_REMOVE_FAIL = 'REACTION_DECK_REMOVE_FAIL';
|
||||
|
||||
export function fetchReactionDeck() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(fetchReactionDeckRequest());
|
||||
|
@ -81,38 +77,3 @@ export function updateReactionDeckFail(error) {
|
|||
skipLoading: true,
|
||||
};
|
||||
}
|
||||
|
||||
export function removeReactionDeck(id) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(removeReactionDeckRequest());
|
||||
|
||||
api(getState).post('/api/v1/remove_reaction_deck', { emojis: [{ id }] }).then(response => {
|
||||
dispatch(removeReactionDeckSuccess(response.data));
|
||||
}).catch(error => {
|
||||
dispatch(removeReactionDeckFail(error));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
export function removeReactionDeckRequest() {
|
||||
return {
|
||||
type: REACTION_DECK_REMOVE_REQUEST,
|
||||
skipLoading: true,
|
||||
};
|
||||
}
|
||||
|
||||
export function removeReactionDeckSuccess(emojis) {
|
||||
return {
|
||||
type: REACTION_DECK_REMOVE_SUCCESS,
|
||||
emojis,
|
||||
skipLoading: true,
|
||||
};
|
||||
}
|
||||
|
||||
export function removeReactionDeckFail(error) {
|
||||
return {
|
||||
type: REACTION_DECK_REMOVE_FAIL,
|
||||
error,
|
||||
skipLoading: true,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -81,4 +81,4 @@ class ReactionEmoji extends ImmutablePureComponent {
|
|||
|
||||
}
|
||||
|
||||
export default connect(injectIntl(ReactionEmoji));
|
||||
export default connect()(injectIntl(ReactionEmoji));
|
||||
|
|
|
@ -136,7 +136,6 @@ class ReactionDeck extends ImmutablePureComponent {
|
|||
{(provided2) => (
|
||||
<div ref={provided2.innerRef} {...provided2.draggableProps} {...provided2.dragHandleProps}>
|
||||
<ReactionEmoji emojiMap={emojiMap}
|
||||
emojiId={emoji.get('id')}
|
||||
emoji={emoji.get('name')}
|
||||
index={index}
|
||||
onChange={this.handleChange}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { List as ImmutableList, fromJS as ConvertToImmutable } from 'immutable';
|
||||
|
||||
import { REACTION_DECK_FETCH_SUCCESS, REACTION_DECK_UPDATE_SUCCESS, REACTION_DECK_REMOVE_SUCCESS } from '../actions/reaction_deck';
|
||||
import { REACTION_DECK_FETCH_SUCCESS, REACTION_DECK_UPDATE_SUCCESS } from '../actions/reaction_deck';
|
||||
|
||||
const initialState = ImmutableList([]);
|
||||
|
||||
export default function reaction_deck(state = initialState, action) {
|
||||
if(action.type === REACTION_DECK_FETCH_SUCCESS || action.type === REACTION_DECK_UPDATE_SUCCESS || action.type === REACTION_DECK_REMOVE_SUCCESS) {
|
||||
if(action.type === REACTION_DECK_FETCH_SUCCESS || action.type === REACTION_DECK_UPDATE_SUCCESS) {
|
||||
state = ConvertToImmutable(action.emojis);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue