fix: remove from channel

This commit is contained in:
Tristan Yang
2022-06-27 23:09:30 +08:00
parent 7e5a70881d
commit aa7c740bcf
+4 -4
View File
@@ -218,7 +218,7 @@ export default function useStreaming() {
const { gid, ...rest } = data; const { gid, ...rest } = data;
dispatch( dispatch(
updateChannel({ updateChannel({
id: gid, gid,
...rest ...rest
}) })
); );
@@ -232,7 +232,7 @@ export default function useStreaming() {
dispatch( dispatch(
updateChannel({ updateChannel({
operation: "add_member", operation: "add_member",
id: gid, gid,
members: uids members: uids
}) })
); );
@@ -241,13 +241,13 @@ export default function useStreaming() {
case "user_leaved_group": case "user_leaved_group":
{ {
const { gid, uid: uids } = data; const { gid, uid: uids } = data;
if (uids.findIndex((id) => id == loginUid) > -1) { if (uids.findIndex((uid) => uid == loginUid) > -1) {
dispatch(removeChannel(gid)); dispatch(removeChannel(gid));
} else { } else {
dispatch( dispatch(
updateChannel({ updateChannel({
operation: "remove_member", operation: "remove_member",
id: gid, gid,
members: uids members: uids
}) })
); );