From aa7c740bcfa7f978551b84abfaa8cb1307422df8 Mon Sep 17 00:00:00 2001 From: Tristan Yang Date: Mon, 27 Jun 2022 23:09:30 +0800 Subject: [PATCH] fix: remove from channel --- src/common/hook/useStreaming/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/hook/useStreaming/index.ts b/src/common/hook/useStreaming/index.ts index 9d7e9fd5..56344dc5 100644 --- a/src/common/hook/useStreaming/index.ts +++ b/src/common/hook/useStreaming/index.ts @@ -218,7 +218,7 @@ export default function useStreaming() { const { gid, ...rest } = data; dispatch( updateChannel({ - id: gid, + gid, ...rest }) ); @@ -232,7 +232,7 @@ export default function useStreaming() { dispatch( updateChannel({ operation: "add_member", - id: gid, + gid, members: uids }) ); @@ -241,13 +241,13 @@ export default function useStreaming() { case "user_leaved_group": { const { gid, uid: uids } = data; - if (uids.findIndex((id) => id == loginUid) > -1) { + if (uids.findIndex((uid) => uid == loginUid) > -1) { dispatch(removeChannel(gid)); } else { dispatch( updateChannel({ operation: "remove_member", - id: gid, + gid, members: uids }) );