Skip to content

Commit

Permalink
fix: 修复会话系统类型出现错乱的问题
Browse files Browse the repository at this point in the history
在某种情况下会出现chat_log的to_uuid是团UUID导致会话系统出错的bug
复现方式:
在会话中插入一条消息。to_uuid是团UUID。即可出现该问题
出现原因仍需排查
  • Loading branch information
moonrailgun committed Aug 4, 2020
1 parent 68707fc commit 5d7e2bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shared/redux/reducers/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ export default produce((draft: ChatState, action) => {
return initialState;
case ADD_CONVERSES: {
const uuid = action.payload.uuid;
if (_isNil(draft.converses[uuid])) {
const type = action.payload.type;
if (
_isNil(draft.converses[uuid]) ||
(type === 'group' && _get(draft.converses, ['uuid', 'type']) === 'user') // 这个case会强制将会话列表中错误的用户会话变成团会话
) {
draft.converses[uuid] = {
msgList: [],
lastMsg: '',
Expand Down

0 comments on commit 5d7e2bb

Please sign in to comment.