aboutsummaryrefslogtreecommitdiff
path: root/modern/src/store/session.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-28 17:08:59 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-28 17:08:59 -0700
commit6a4eba7b63c84c20188b8a6b16f6107698bfde91 (patch)
treee486dbb32afadee5c2e2c7151d963871820eeb4f /modern/src/store/session.js
parent17b990eabe36138a4a879deef8d03b16ee27e1ba (diff)
downloadtrackermap-web-6a4eba7b63c84c20188b8a6b16f6107698bfde91.tar.gz
trackermap-web-6a4eba7b63c84c20188b8a6b16f6107698bfde91.tar.bz2
trackermap-web-6a4eba7b63c84c20188b8a6b16f6107698bfde91.zip
Move positions to session
Diffstat (limited to 'modern/src/store/session.js')
-rw-r--r--modern/src/store/session.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/modern/src/store/session.js b/modern/src/store/session.js
index 88d1eb44..74dc29a0 100644
--- a/modern/src/store/session.js
+++ b/modern/src/store/session.js
@@ -6,6 +6,7 @@ const { reducer, actions } = createSlice({
server: null,
user: null,
socket: null,
+ positions: {},
},
reducers: {
updateServer(state, action) {
@@ -17,6 +18,9 @@ const { reducer, actions } = createSlice({
updateSocket(state, action) {
state.socket = action.payload;
},
+ updatePositions(state, action) {
+ action.payload.forEach((position) => state.positions[position.deviceId] = position);
+ },
},
});