fix: public member list error

This commit is contained in:
zerosoul
2022-04-10 10:02:06 +08:00
parent 9f909a85d3
commit 23496d0baf
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -29,8 +29,16 @@ const channelsSlice = createSlice({
state.byId[gid] = rest;
},
updateChannel(state, action) {
const ignoreInPublic = ["add_member", "remove_member"];
// console.log("set channels store", action);
const { id, operation, members, ...rest } = action.payload;
const { id, operation, members = [], ...rest } = action.payload;
const currChannel = state.byId[id];
if (
!currChannel ||
(currChannel.is_public && ignoreInPublic.includes(operation))
)
return;
switch (operation) {
case "remove_member":
{