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 4d3842f0..bba3bec5 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 @@ -71,12 +71,21 @@ export const reducer = createReducer( }), on(updateSuccess, (state, action) => { + const curRoomInfo = state.roomInfo; + let roomName = curRoomInfo.roomName; + let receiveAlarm = curRoomInfo.receiveAlarm; + + if (curRoomInfo.roomSeq === action.res.roomSeq) { + roomName = action.res.roomName; + receiveAlarm = action.res.receiveAlarm; + } + return { ...state, roomInfo: { ...state.roomInfo, - roomName: action.res.roomName, - receiveAlarm: action.res.receiveAlarm + roomName, + receiveAlarm } }; }),