diff --git a/package.json b/package.json index 6bea69b9..6fa15125 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trixta/trixta-js", - "version": "4.1.2", + "version": "4.1.3", "description": "Javascript library to integrate Trixta", "source": "src/index.ts", "main": "dist/@trixta/trixta-js.cjs.js", diff --git a/src/React/reducers/__tests__/reducers.test.ts b/src/React/reducers/__tests__/reducers.test.ts index 40824652..57293612 100644 --- a/src/React/reducers/__tests__/reducers.test.ts +++ b/src/React/reducers/__tests__/reducers.test.ts @@ -41,9 +41,13 @@ describe('trixtaReducer', () => { it('signoutTrixta should return the initial state', () => { state = trixtaState; const expectedResult = produce(state, (draft) => { - draft = initialState; + draft.actions = initialState.actions; + draft.error = initialState.error; + draft.reactions = initialState.reactions; + draft.authorizingStatus = initialState.authorizingStatus; + draft.authorizationStarted = initialState.authorizationStarted; + draft.agentDetails = initialState.agentDetails; }); - expect(trixtaReducer(state, signoutTrixta())).toEqual(expectedResult); }); diff --git a/src/React/reducers/trixtaReducer.ts b/src/React/reducers/trixtaReducer.ts index 7570b3c6..128ab138 100644 --- a/src/React/reducers/trixtaReducer.ts +++ b/src/React/reducers/trixtaReducer.ts @@ -57,7 +57,11 @@ export const trixtaReducer = ( produce(state, (draft: Draft) => { switch (action.type) { case SIGN_OUT_TRIXTA: - draft = initialState; + draft.actions = initialState.actions; + draft.error = initialState.error; + draft.reactions = initialState.reactions; + draft.authorizingStatus = initialState.authorizingStatus; + draft.agentDetails = initialState.agentDetails; break; case channelActionTypes.CHANNEL_JOIN_ERROR: {