From a57390425913896128b2472ae95e1504c521422f Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Thu, 5 May 2022 00:00:31 -0500 Subject: Geofences now center when clicked in /geofences --- modern/src/store/geofences.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modern/src/store/geofences.js') diff --git a/modern/src/store/geofences.js b/modern/src/store/geofences.js index f2b7666..0c83965 100644 --- a/modern/src/store/geofences.js +++ b/modern/src/store/geofences.js @@ -4,8 +4,15 @@ const { reducer, actions } = createSlice({ name: 'geofences', initialState: { items: {}, + selectedId: null, }, reducers: { + select(state, action) { + state.selectedId = action.payload.id; + }, + unselect(state, action) { + state.selectedId = null; + }, refresh(state, action) { state.items = {}; action.payload.forEach((item) => state.items[item.id] = item); -- cgit v1.2.3