This commit is contained in:
parent
70469962be
commit
6449efb56d
|
|
@ -9,7 +9,6 @@ const NoticeWindow: React.FC = () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const channel = new BroadcastChannel('meeting_channel');
|
const channel = new BroadcastChannel('meeting_channel');
|
||||||
let time: NodeJS.Timeout;
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
channel.onmessage = function (event) {
|
channel.onmessage = function (event) {
|
||||||
const { type, noticeItem } = event.data;
|
const { type, noticeItem } = event.data;
|
||||||
|
|
@ -64,6 +63,15 @@ const NoticeWindow: React.FC = () => {
|
||||||
>拒绝</Button>
|
>拒绝</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>,
|
</div>,
|
||||||
|
onClose: () => {
|
||||||
|
const dom = document.getElementsByClassName('ant-notification')
|
||||||
|
if (dom.length === 0) {
|
||||||
|
window.electron.setChildWindowShow({
|
||||||
|
key: 'noticeWindow',
|
||||||
|
bool: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
duration: 10,
|
duration: 10,
|
||||||
placement: 'bottomRight',
|
placement: 'bottomRight',
|
||||||
showProgress: true,
|
showProgress: true,
|
||||||
|
|
@ -72,24 +80,10 @@ const NoticeWindow: React.FC = () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
|
||||||
useEffect(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
time = setInterval(() => {
|
|
||||||
const dom = document.getElementsByClassName('ant-notification')
|
|
||||||
if (dom.length === 0) {
|
|
||||||
window.electron.setChildWindowShow({
|
|
||||||
key: 'noticeWindow',
|
|
||||||
bool: false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}, 1000)
|
|
||||||
}, 4000);
|
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(time)
|
|
||||||
channel.close();
|
channel.close();
|
||||||
};
|
};
|
||||||
}, [])
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className={`${styles.noticeWindow} drag`}>
|
<div className={`${styles.noticeWindow} drag`}>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue