aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/devices.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 23:03:05 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-20 23:03:05 -0700
commit9238895c99c30c442ce8dae41b61f898a79dd89b (patch)
tree9488fa21fbcf6a78eefcf015ed73cd44e7415b97 /modern/src/store/devices.js
parent37dd8129f8e07d00eb93262210bf1ecd4ce95532 (diff)
downloadtrackermap-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.js4
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);
},