This commit is contained in:
yj 2024-10-18 17:39:27 +08:00
parent cfd0d1ceef
commit 30d739c894
5 changed files with 21 additions and 12 deletions

View File

@ -349,6 +349,14 @@ app.on('ready', () => {
break;
}
});
// 隐藏显示子窗口
ipcMain.handle('setChildWindowShow', (event, config) => {
if (config.bool) {
childWindow[config.key].show()
} else {
childWindow[config.key].hide()
}
});
// 隐藏主窗口
ipcMain.handle('mainWindowHide', () => {
mainWindowHide()

View File

@ -94,6 +94,10 @@ window.electron = {
ipcRenderer.invoke('setChildWindow', config)
},
// 隐藏主窗口
setChildWindowShow: (config) => {
ipcRenderer.invoke('setChildWindowShow', config)
},
// 隐藏主窗口
mainWindowHide: () => {
ipcRenderer.invoke('mainWindowHide')
},

View File

@ -78,10 +78,9 @@ const NoticeWindow: React.FC = () => {
time = setInterval(() => {
const dom = document.getElementsByClassName('ant-notification')
if (dom.length === 0) {
window.electron.setChildWindow({
height: 1,
width: 1,
window.electron.setChildWindowShow({
key: 'noticeWindow',
bool: false
})
}
}, 1000)

View File

@ -660,17 +660,14 @@ const Meeting: React.FC = () => {
case 'ApplyToSpeak':
setIsScreenCapture(bool => {
if (bool) {
window.electron.setChildWindow({
width: 388,
height: 150,
window.electron.setChildWindowShow({
key: 'noticeWindow',
bool: true
})
setTimeout(() => {
channel.postMessage({
type: 'noticeItem',
noticeItem: item
});
}, 1000)
} else {
api.open({
message: '',

1
src/render.d.ts vendored
View File

@ -22,6 +22,7 @@ export interface IElectronAPI {
getRegistry: () => any;
createChildWindow: (config: any) => void;
setChildWindow: (config: any) => void;
setChildWindowShow: (config: any) => void;
closeChildWindow: (key: string) => void;
mainWindowCenter: () => any;
mainWindowHide: () => any;