mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* Moving entityGetter to utility folder * Import whitespace and if statement braces * newlines between multi-line if's
29 lines
620 B
JavaScript
29 lines
620 B
JavaScript
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
|
|
import { RENDER_FLASH, HIDE_FLASH } from './actions';
|
|
|
|
export const initialState = {
|
|
alertType: null,
|
|
isVisible: false,
|
|
message: null,
|
|
undoAction: null,
|
|
};
|
|
|
|
export default (state = initialState, { type, payload }) => {
|
|
switch (type) {
|
|
case RENDER_FLASH:
|
|
return {
|
|
alertType: payload.alertType,
|
|
isVisible: true,
|
|
message: payload.message,
|
|
undoAction: payload.undoAction,
|
|
};
|
|
case HIDE_FLASH:
|
|
case LOCATION_CHANGE:
|
|
return {
|
|
...initialState,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|