yangjie #22
15
main.js
15
main.js
|
|
@ -92,7 +92,15 @@ function createTray() {
|
|||
},
|
||||
{
|
||||
label: '退出', click: async () => {
|
||||
const url = mainWindow.webContents.getURL();
|
||||
const hash = new URL(url).hash;
|
||||
if (hash.indexOf('/meeting') === -1) {
|
||||
quit()
|
||||
} else {
|
||||
await mainWindow.webContents.send('quitAndInstall');
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
}
|
||||
},
|
||||
// icon: iconPath,
|
||||
},
|
||||
|
|
@ -205,9 +213,12 @@ app.on('ready', () => {
|
|||
clipboard.writeText(text)
|
||||
});
|
||||
// 退出
|
||||
ipcMain.handle('quit', async (event) => {
|
||||
await mainWindow.webContents.send('quitAndInstall');
|
||||
ipcMain.handle('quit', async (event, bool) => {
|
||||
if (bool) {
|
||||
quit()
|
||||
} else {
|
||||
await mainWindow.webContents.send('quitAndInstall');
|
||||
}
|
||||
});
|
||||
// 加入房间通知
|
||||
ipcMain.handle('joinNotification', (event, user) => {
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ window.electron = {
|
|||
ipcRenderer.on('onQuit', callback)
|
||||
},
|
||||
// 退出房间
|
||||
quit: () => {
|
||||
return ipcRenderer.invoke('quit')
|
||||
quit: (bool) => {
|
||||
return ipcRenderer.invoke('quit', bool)
|
||||
},
|
||||
// 监听更新
|
||||
onUpdate: (callback) => {
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ const App: React.FC = () => {
|
|||
storage.setItem('setting', JSON.stringify(setting))
|
||||
})
|
||||
window.electron.quitAndInstall(async (_e: any) => {
|
||||
leaveChannel()
|
||||
storage.setItem('quitMeeting', true)
|
||||
})
|
||||
}, [])
|
||||
useEffect(() => {
|
||||
|
|
@ -138,14 +138,14 @@ const App: React.FC = () => {
|
|||
setIsState(false)
|
||||
window.electron.onQuit(async () => {
|
||||
if (location.hash.indexOf('/login') === 1) {
|
||||
window.electron.quit()
|
||||
window.electron.quit(location.hash.indexOf('/meeting') === -1)
|
||||
} else {
|
||||
if (storage.getItem('isTips') === 'true') {
|
||||
const setting = JSON.parse(storage.getItem('setting') as string)
|
||||
if (setting.closeSetting === 'hide') {
|
||||
window.electron.setViewStatus(setting.closeSetting)
|
||||
} else {
|
||||
window.electron.quit()
|
||||
window.electron.quit(location.hash.indexOf('/meeting') === -1)
|
||||
}
|
||||
} else {
|
||||
quitTipsRef.current.changeModal()
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const QuitTips = forwardRef((props: any, ref: any) => {
|
|||
<Button type="primary" className='m-ant-btn' onClick={() => {
|
||||
setIsCloseModal(false)
|
||||
if (optionsValue === 'quit') {
|
||||
window.electron.quit()
|
||||
window.electron.quit(location.hash.indexOf('/meeting') === -1)
|
||||
} else {
|
||||
window.electron.setViewStatus(optionsValue)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ const Meeting: React.FC = () => {
|
|||
userVideo: false,
|
||||
})
|
||||
const [isSharedScreenModal, setIsSharedScreenModal] = useState(false);
|
||||
const [quitMeetingModal, setQuitMeetingModal] = useState(false);
|
||||
const [user, setUser] = useState<any>({});
|
||||
const [sharedScreenList, setSharedScreenList] = useState<any>([]);
|
||||
const [sharedScreenItem, setSharedScreenItem] = useState<any>('');
|
||||
|
|
@ -152,7 +153,7 @@ const Meeting: React.FC = () => {
|
|||
text: '网络质量极好。'
|
||||
})
|
||||
const [networkOther, setNetworkOther] = useState<RtcStats>({})
|
||||
const [isComputerAudio, setIsComputerAudio] = useState(true)
|
||||
const [isComputerAudio, setIsComputerAudio] = useState(false)
|
||||
const [_isScreenCapture, setIsScreenCapture] = useState(false)
|
||||
const [isFluencyPriority, setIsFluencyPriority] = useState(false)
|
||||
const [open, setOpen] = useState(false)
|
||||
|
|
@ -1634,6 +1635,11 @@ const Meeting: React.FC = () => {
|
|||
case 'meetingMode':
|
||||
setMeetingMode(e.value)
|
||||
break;
|
||||
case 'quitMeeting':
|
||||
if (e.value) {
|
||||
setQuitMeetingModal(true)
|
||||
}
|
||||
break;
|
||||
case 'reconnect':
|
||||
if (e.value == true) {
|
||||
await onInvoke('joinChannel', {
|
||||
|
|
@ -2724,6 +2730,43 @@ const Meeting: React.FC = () => {
|
|||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
<Modal
|
||||
title=""
|
||||
open={quitMeetingModal}
|
||||
footer={null}
|
||||
closable={false}
|
||||
centered
|
||||
width={'190px'}
|
||||
>
|
||||
<div>
|
||||
<div className='meetingContentFooterPopover'>
|
||||
{role.ID.includes(user.roleId) ?
|
||||
<Popconfirm
|
||||
title="提示"
|
||||
description={`结束会议后,所有人将退出,是否结束?`}
|
||||
onConfirm={async () => {
|
||||
await GetLeaveAll({
|
||||
roomNum: state.channelId,
|
||||
})
|
||||
window.electron.quit(true)
|
||||
}}
|
||||
onCancel={() => {
|
||||
|
||||
}}
|
||||
okText="结束"
|
||||
cancelText="取消"
|
||||
>
|
||||
<div className='meetingContentFooterPopoverDel'>全员结束会议</div>
|
||||
</Popconfirm>
|
||||
: null}
|
||||
<div className='meetingContentFooterPopoverDefault' onClick={async () => {
|
||||
await leaveChannel()
|
||||
window.electron.quit(true)
|
||||
}}>仅自己离开</div>
|
||||
<div className='meetingContentFooterPopoverCancel' onClick={() => { setQuitMeetingModal(false) }}>取消</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
<SharedFilesModel ref={sharedFilesModelRef} />
|
||||
<SpeakerModeModal ref={speakerModeModalRef} />
|
||||
<InvitingPersonnelModal ref={invitingPersonnelRef} />
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export interface IElectronAPI {
|
|||
selectFilePath: (data?: any) => void
|
||||
onFilePath: (callBack: Function) => void;
|
||||
getSources: () => any;
|
||||
quit: () => any;
|
||||
quit: (bool) => any;
|
||||
downFile: (callBack: Function) => void;
|
||||
quitAndInstall: (callBack: Function) => void;
|
||||
getVersion: () => Promise<string>;
|
||||
|
|
|
|||
Loading…
Reference in New Issue