Skip to content

Commit

Permalink
Update Communicator.reducer.js to use deepCopy for communicators
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed Jul 24, 2024
1 parent 2030813 commit a3e6dcc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Communicator/Communicator.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand All @@ -48,7 +49,10 @@ function communicatorReducer(state = initialState, action) {
};

case LOGOUT:
return initialState;
return {
...initialState,
communicators: deepCopy(defaultCommunicators)
};

case IMPORT_COMMUNICATOR:
return {
Expand Down

0 comments on commit a3e6dcc

Please sign in to comment.