From 0591f6a62eb9b50704038de87b24cf806f417d4b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 28 Dec 2023 08:42:13 -0800 Subject: Add logs report page --- modern/src/store/session.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modern/src/store') diff --git a/modern/src/store/session.js b/modern/src/store/session.js index a95cfec8..bfe94a41 100644 --- a/modern/src/store/session.js +++ b/modern/src/store/session.js @@ -6,6 +6,8 @@ const { reducer, actions } = createSlice({ server: null, user: null, socket: null, + includeLogs: false, + logs: [], positions: {}, history: {}, }, @@ -19,6 +21,15 @@ const { reducer, actions } = createSlice({ updateSocket(state, action) { state.socket = action.payload; }, + enableLogs(state, action) { + state.includeLogs = action.payload; + if (!action.payload) { + state.logs = []; + } + }, + updateLogs(state, action) { + state.logs.push(...action.payload); + }, updatePositions(state, action) { const liveRoutes = state.user.attributes.mapLiveRoutes || state.server.attributes.mapLiveRoutes || 'none'; const liveRoutesLimit = state.user.attributes['web.liveRouteLength'] || state.server.attributes['web.liveRouteLength'] || 10; -- cgit v1.2.3