Skip to content
Snippets Groups Projects
Commit 386c3968 authored by DD Liu's avatar DD Liu
Browse files

add to monitors instead of replacing them. We will have a separate action for removing monitors.

parent 2e6c37a9
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,9 @@ const initialState = []; ...@@ -5,8 +5,9 @@ const initialState = [];
const reducer = function (state, action) { const reducer = function (state, action) {
if (typeof state === 'undefined') state = initialState; if (typeof state === 'undefined') state = initialState;
switch (action.type) { switch (action.type) {
// Adds or updates monitors
case UPDATE_MONITORS: case UPDATE_MONITORS:
return [...action.monitors]; return [...action.monitors, ...state];
default: default:
return state; return state;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment