diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts index 58719033..9b6fc5e2 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/event/reducers.ts @@ -1,6 +1,7 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; import { infoSuccess, appendInfoList, info, infoFailure } from './actions'; +import * as AuthenticationStore from '@app/store/account/authentication'; export const reducer = createReducer( initialState, @@ -32,5 +33,11 @@ export const reducer = createReducer( ...state, infoList: [...state.infoList, action.info] }; + }), + + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) ); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/option/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/option/reducers.ts index c4ac660b..df652195 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/option/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/option/reducers.ts @@ -1,6 +1,7 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; import { regViewSuccess, regUpdateSuccess } from './actions'; +import * as AuthenticationStore from '@app/store/account/authentication'; export const reducer = createReducer( initialState, @@ -15,5 +16,10 @@ export const reducer = createReducer( ...state, reg: action.res }; + }), + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) ); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts index 53314fe9..1cf7e2c0 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/query/reducers.ts @@ -2,6 +2,8 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; import { authSuccess, deptSuccess, deptUserSuccess } from './actions'; +import * as AuthenticationStore from '@app/store/account/authentication'; + export const reducer = createReducer( initialState, on(authSuccess, (state, action) => { @@ -24,5 +26,10 @@ export const reducer = createReducer( selectedDepartmentUserInfoList: action.userInfos, selectedDepartmentStatus: action.res }; + }), + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) ); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts index daf11df6..ac717cab 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/room/reducers.ts @@ -2,6 +2,8 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; import { infoSuccess } from './actions'; +import * as AuthenticationStore from '@app/store/account/authentication'; + export const reducer = createReducer( initialState, on(infoSuccess, (state, action) => { @@ -11,5 +13,11 @@ export const reducer = createReducer( userInfoList: action.userInfoList, userInfoShortList: action.userInfoShortList }; + }), + + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) ); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/status/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/status/reducers.ts index 91e6f681..300d62a1 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/status/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/status/reducers.ts @@ -2,6 +2,8 @@ import { createReducer, on } from '@ngrx/store'; import { initialState } from './state'; import { bulkInfoSuccess } from './actions'; +import * as AuthenticationStore from '@app/store/account/authentication'; + export const reducer = createReducer( initialState, on(bulkInfoSuccess, (state, action) => { @@ -9,5 +11,11 @@ export const reducer = createReducer( ...state, statusBulkInfoList: action.statusBulkInfoList }; + }), + + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) ); diff --git a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts index 32ac7b2a..2db0ae37 100644 --- a/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts +++ b/projects/ucap-webmessenger-app/src/app/store/messenger/sync/reducers.ts @@ -18,6 +18,8 @@ import { RoomUserData } from '@ucap-webmessenger/protocol-sync'; +import * as AuthenticationStore from '@app/store/account/authentication'; + export const reducer = createReducer( initialState, on(buddy2Success, (state, action) => { @@ -91,5 +93,11 @@ export const reducer = createReducer( { ...state.room } ) }; + }), + + on(AuthenticationStore.logout, (state, action) => { + return { + ...initialState + }; }) );