yangjie #22
|
|
@ -2,7 +2,14 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss'
|
|||
import { useEffect, useState } from "react";
|
||||
const CurrentSpeakUserWindow: React.FC = () => {
|
||||
const [inputValue, setInputValue] = useState('')
|
||||
const channel = new BroadcastChannel('meeting_channel');
|
||||
useEffect(() => {
|
||||
let time: NodeJS.Timeout;
|
||||
time = setInterval(() => {
|
||||
channel.postMessage({
|
||||
type: 'currentSpeakUserWindowGetUserName'
|
||||
})
|
||||
}, 1000)
|
||||
window.electron.windowHandleMessageCallBack((_e: any, data: any) => {
|
||||
if (data.parmes.currentSpeakUser.length) {
|
||||
setInputValue(data.parmes.currentSpeakUser.join(';'))
|
||||
|
|
@ -10,6 +17,9 @@ const CurrentSpeakUserWindow: React.FC = () => {
|
|||
setInputValue('')
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
clearInterval(time)
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -374,30 +374,31 @@ const Meeting: React.FC = () => {
|
|||
userId: noticeWindowPostRoomManager.uid
|
||||
})
|
||||
break;
|
||||
case 'currentSpeakUserWindowGetUserName':
|
||||
setSpeackUid((uids: any) => {
|
||||
const usernames: string[] = [];
|
||||
setRoomUserList((res: any) => {
|
||||
uids.forEach((uid: any) => {
|
||||
const user = res.find((item: any) => item.uid == uid);
|
||||
if (user) {
|
||||
usernames.push(user.userName);
|
||||
}
|
||||
})
|
||||
window.electron.windowHandleMessage({
|
||||
key: 'currentSpeakUserWindow',
|
||||
parmes: {
|
||||
currentSpeakUser: usernames,
|
||||
}
|
||||
})
|
||||
return res
|
||||
});
|
||||
return []
|
||||
})
|
||||
break;
|
||||
}
|
||||
}
|
||||
time = setInterval(() => {
|
||||
setCurrentSeconds(currentSeconds++)
|
||||
setSpeackUid((uids: any) => {
|
||||
const usernames: string[] = [];
|
||||
setRoomUserList((res: any) => {
|
||||
uids.forEach((uid: any) => {
|
||||
const user = res.find((item: any) => item.uid == uid);
|
||||
if (user) {
|
||||
usernames.push(user.userName);
|
||||
}
|
||||
})
|
||||
window.electron.windowHandleMessage({
|
||||
key: 'currentSpeakUserWindow',
|
||||
parmes: {
|
||||
currentSpeakUser: usernames,
|
||||
}
|
||||
})
|
||||
return res
|
||||
});
|
||||
|
||||
return []
|
||||
})
|
||||
}, 1000)
|
||||
// 首次加载图标更新
|
||||
const firstFooterList = [...footerList]
|
||||
|
|
|
|||
Loading…
Reference in New Issue