* Fix EmojiFormatter failure * Add notification_emails.warning setting default value * Fix list spec failure and add antennas for spec response * Fix domain block spec failure to add kb custom response * Fix SearchQueryTransformer spec failure * Fix Account#matches_display_name spec failure * Fix UpdateStatusService changes mentions spec failure * Fix RuboCop Lint * Ignore brakeman warning * Fix CI failure for ignore brakeman warning * Fix migration failure * Fix README * Fix migration CI failure * Fix some spec failure * Format code for RuboCop lint failure * Fix ESlint failure * Fix haml-lint failure
26 lines
611 B
JavaScript
26 lines
611 B
JavaScript
import { Map as ImmutableMap, fromJS } from 'immutable';
|
|
|
|
import {
|
|
ANTENNAS_FETCH_SUCCESS,
|
|
} from '../actions/antennas';
|
|
|
|
const initialState = ImmutableMap();
|
|
|
|
const normalizeAntenna = (state, antenna) => state.set(antenna.id, fromJS(antenna));
|
|
|
|
const normalizeAntennas = (state, antennas) => {
|
|
antennas.forEach(antenna => {
|
|
state = normalizeAntenna(state, antenna);
|
|
});
|
|
|
|
return state;
|
|
};
|
|
|
|
export default function antennas(state = initialState, action) {
|
|
switch(action.type) {
|
|
case ANTENNAS_FETCH_SUCCESS:
|
|
return normalizeAntennas(state, action.antennas);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|