fix: joined show memebers sometimes

This commit is contained in:
Tristan Yang
2023-03-31 21:31:14 +08:00
parent 32bdef4e0d
commit d73f5b940f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ const channelsSlice = createSlice({
c.avatar_updated_at == 0
? ""
: `${BASE_URL}/resource/group_avatar?gid=${c.gid}&t=${c.avatar_updated_at}`,
visibleAside: "members"
visibleAside: state.byId[c.gid]?.visibleAside ?? null
};
});
},
+2 -2
View File
@@ -18,7 +18,7 @@ type Props = {
const RTCWidget = ({ id, context = "channel" }: Props) => {
const { t } = useTranslation("chat");
const { leave, voicingInfo, setMute, setDeafen } = useVoice({ context, id });
const { leave, voicingInfo, setMute, setDeafen, joining = true } = useVoice({ context, id });
const { loginUser, channelData, userData } = useAppSelector(store => {
return {
userData: store.users.byId,
@@ -26,7 +26,7 @@ const RTCWidget = ({ id, context = "channel" }: Props) => {
loginUser: store.authData.user,
};
});
if (!loginUser || !voicingInfo) return null;
if (!loginUser || !voicingInfo || joining) return null;
const name = voicingInfo.context == "channel" ? channelData[voicingInfo.id]?.name : userData[voicingInfo.id]?.name;
if (!name) return null;
return (