This commit is contained in:
parent
7e9ad23c49
commit
810c68bc96
10
src/App.tsx
10
src/App.tsx
|
|
@ -9,7 +9,7 @@ import Meeting from '@/page/Meeting/index'
|
|||
import NotFound from '@/page/NotFound/index'
|
||||
import { storage } from '@/utils'
|
||||
import { message, Spin } from "antd";
|
||||
import { onOtherSignalr, onReconnected, onStart, startSignalr } from "@/utils/package/signalr";
|
||||
import { onOtherSignalr, onReconnected, onStart, onStop, startSignalr } from "@/utils/package/signalr";
|
||||
import JoinMeetingModal from "@/components/JoinMeetingModal";
|
||||
import UpdateModal from "@/components/UpdateModal";
|
||||
import * as CryptoJS from 'crypto-js';
|
||||
|
|
@ -121,7 +121,8 @@ const App: React.FC = () => {
|
|||
joinMeetingModalRef.current.changeModal(item)
|
||||
break;
|
||||
case 'ForceLogout':
|
||||
await leaveChannel()
|
||||
message.error(item.message)
|
||||
await leaveChannel(true)
|
||||
toSrc('/login')
|
||||
break;
|
||||
}
|
||||
|
|
@ -131,6 +132,7 @@ const App: React.FC = () => {
|
|||
useEffect(() => {
|
||||
try {
|
||||
if (location.hash.indexOf('/login') !== -1) {
|
||||
onStop()
|
||||
window.electron.setMainWindowSize({
|
||||
width: 752,
|
||||
height: 520,
|
||||
|
|
@ -219,12 +221,14 @@ const App: React.FC = () => {
|
|||
|
||||
}
|
||||
};
|
||||
const leaveChannel = async (): Promise<void> => {
|
||||
const leaveChannel = async (bool?: boolean): Promise<void> => {
|
||||
if (location.hash.indexOf('/meeting') === 1) {
|
||||
const data = JSON.parse(localStorage.stateInfo);
|
||||
if (!bool) {
|
||||
await GetLeave({
|
||||
roomNum: data.channelId,
|
||||
})
|
||||
}
|
||||
await agora.leaveChannel()
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import {
|
|||
} from "agora-electron-sdk";
|
||||
import { GetRoomRtcToken } from "@/api/Home/Index";
|
||||
import { storage } from '@/utils';
|
||||
import { onStop } from "./signalr";
|
||||
const option: any = {
|
||||
appId: 'dcfc466a6ecb4a1f972630065dfb1e75',
|
||||
token: '',
|
||||
|
|
@ -137,7 +136,6 @@ const agora = {
|
|||
stopAllEffect: true,
|
||||
stopMicrophoneRecording: true,
|
||||
})
|
||||
onStop()
|
||||
agora.stopScreenCapture()
|
||||
agora.release()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -163,6 +163,7 @@ export const onInvoke = async (str: string, data: any) => {
|
|||
export const onStop = async () => {
|
||||
if (connection) {
|
||||
connection.stop()
|
||||
connection = ""
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue