From 6a4eba7b63c84c20188b8a6b16f6107698bfde91 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 28 Oct 2022 17:08:59 -0700 Subject: Move positions to session --- modern/src/store/session.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modern/src/store/session.js') 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); + }, }, }); -- cgit v1.2.3