Skip to content

Commit

Permalink
fix: 修复removeUserConverse的操作错误
Browse files Browse the repository at this point in the history
并修复了chat state 的类型问题
  • Loading branch information
moonrailgun committed Jan 22, 2020
1 parent 4a890e5 commit 55a1a3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
3 changes: 2 additions & 1 deletion src/shared/redux/actions/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { renewableDelayTimer } from '../../utils/timer';
import config from '../../project.config';
import _without from 'lodash/without';
import _isFunction from 'lodash/isFunction';
import _filter from 'lodash/filter';
import { MsgPayload, ConverseInfo } from '@src/shared/redux/types/chat';
import { TRPGAction } from '../types/__all__';
import { isUserUUID } from '@shared/utils/uuid';
Expand Down Expand Up @@ -208,7 +209,7 @@ export const removeUserConverse = (userConverseUUID: string): TRPGAction => {
// 在localStorage删除
const userUUID = getState().user.info.uuid;
const converses = getState().chat.converses;
const uuids = Object.keys(converses.filter((c) => c.type === 'user'));
const uuids = Object.keys(_filter(converses, (c) => c.type === 'user'));
rnStorage.set(
getUserConversesHash(userUUID),
_without(uuids, userConverseUUID)
Expand Down
14 changes: 1 addition & 13 deletions src/shared/redux/types/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,7 @@ type WritingListType = {
};
};

export type ChatStateConverseMsgListItem = {
room: string;
uuid: string;
sender: string;
sender_uuid: string;
to_uuid: string;
type: string;
is_public: boolean;
message: string;
date: number;
};

export type ChatStateConverseMsgList = ChatStateConverseMsgListItem[];
export type ChatStateConverseMsgList = MsgPayload[];

export type ChatStateConverse = {
uuid: string;
Expand Down

0 comments on commit 55a1a3b

Please sign in to comment.