fix: channel aside visible while logout

This commit is contained in:
Tristan Yang
2023-04-06 12:21:54 +08:00
parent e2b560a76a
commit 1e9d123338
4 changed files with 28 additions and 13 deletions
+2 -1
View File
@@ -57,11 +57,11 @@ const Voice = () => {
});
//remote user leave
agoraEngine.on("user-left", (user, reason) => {
console.log(user, "has left the channel");
switch (reason) {
case "Quit":
case "ServerTimeOut": {
dispatch(removeVoiceMember(+user.uid as number));
console.log(user, "has left the channel");
}
break;
default:
@@ -206,6 +206,7 @@ const useVoice = ({ id, context = "channel" }: VoiceProps) => {
dispatch(updateChannelVisibleAside({
id, aside: null
}));
// 即时更新对应的活跃列表信息
dispatch(upsertVoiceList({
id,
context,