diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 23:03:05 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-09-20 23:03:05 -0700 |
commit | 9238895c99c30c442ce8dae41b61f898a79dd89b (patch) | |
tree | 9488fa21fbcf6a78eefcf015ed73cd44e7415b97 /modern/src/store/devices.js | |
parent | 37dd8129f8e07d00eb93262210bf1ecd4ce95532 (diff) | |
download | trackermap-web-9238895c99c30c442ce8dae41b61f898a79dd89b.tar.gz trackermap-web-9238895c99c30c442ce8dae41b61f898a79dd89b.tar.bz2 trackermap-web-9238895c99c30c442ce8dae41b61f898a79dd89b.zip |
Handle list refresh
Diffstat (limited to 'modern/src/store/devices.js')
-rw-r--r-- | modern/src/store/devices.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modern/src/store/devices.js b/modern/src/store/devices.js index 3d7be3e6..66c1607f 100644 --- a/modern/src/store/devices.js +++ b/modern/src/store/devices.js @@ -7,6 +7,10 @@ const { reducer, actions } = createSlice({ selectedId: null }, reducers: { + refresh(state, action) { + state.items = {}; + action.payload.forEach(item => state.items[item['id']] = item); + }, update(state, action) { action.payload.forEach(item => state.items[item['id']] = item); }, |