From a3e6dccd47ac1919b64aa00e9939d23a8eafb357 Mon Sep 17 00:00:00 2001 From: Rodri Sanchez Date: Wed, 24 Jul 2024 19:22:29 -0300 Subject: [PATCH] Update Communicator.reducer.js to use deepCopy for communicators --- src/components/Communicator/Communicator.reducer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Communicator/Communicator.reducer.js b/src/components/Communicator/Communicator.reducer.js index 7c6ec7130..bb15fb675 100644 --- a/src/components/Communicator/Communicator.reducer.js +++ b/src/components/Communicator/Communicator.reducer.js @@ -24,10 +24,11 @@ import { } from './Communicator.constants'; import { LOGIN_SUCCESS, LOGOUT } from '../Account/Login/Login.constants'; import moment from 'moment'; +import { deepCopy } from '../../helpers'; export const defaultCommunicatorID = 'cboard_default'; const initialState = { - communicators: defaultCommunicators, + communicators: deepCopy(defaultCommunicators), activeCommunicatorId: defaultCommunicatorID }; @@ -48,7 +49,10 @@ function communicatorReducer(state = initialState, action) { }; case LOGOUT: - return initialState; + return { + ...initialState, + communicators: deepCopy(defaultCommunicators) + }; case IMPORT_COMMUNICATOR: return {