diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 5ba8ea5..884b7d7 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -171,6 +171,7 @@ const Meeting: React.FC = () => { }) const [networkOther, setNetworkOther] = useState({}) const [isComputerAudio, setIsComputerAudio] = useState(false) + const [_isLeave, setIsLeave] = useState(false) const [isScreenCapture, setIsScreenCapture] = useState(false) const [isFluencyPriority, setIsFluencyPriority] = useState(false) const [open, setOpen] = useState(false) @@ -884,7 +885,7 @@ const Meeting: React.FC = () => { }, 1, 3) message.error('录制失败,请重新录制!') } - recorder.onstop = async (event: any) => { + recorder.onstop = async () => { } recorder.ondataavailable = async (event: any) => { @@ -915,6 +916,16 @@ const Meeting: React.FC = () => { onCancel() { } }) + setIsLeave(bool => { + if (bool) { + if (userInfo.isAnonymous) { + storage.setItem('userLogin', false) + } else { + navigate('/home/index') + } + } + return false + }) }; reader.readAsArrayBuffer(blob); } @@ -1680,6 +1691,7 @@ const Meeting: React.FC = () => { } // 退出房间 const leaveChannel = async (bool: boolean = true): Promise => { + setIsLeave(true) await stopScreenCapture() await stopRecorderMedia() if (bool) { @@ -1687,12 +1699,19 @@ const Meeting: React.FC = () => { } await agora.leaveChannel() setTimeout(() => { - if (userInfo.isAnonymous) { - storage.setItem('userLogin', false) - } else { - navigate('/home/index') - } - }, 2000) + setRecorder((res: any) => { + if (res) { + + } else { + if (userInfo.isAnonymous) { + storage.setItem('userLogin', false) + } else { + navigate('/home/index') + } + } + return res + }) + }, 1000) } // 分享屏幕 const clickSharedScreen = async (): Promise => {