This commit is contained in:
parent
7cae77f946
commit
fa6b85e4f5
|
|
@ -2,7 +2,14 @@ import styles from '@/page/Meeting/CurrentSpeakUserWindow/index.module.scss'
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
const CurrentSpeakUserWindow: React.FC = () => {
|
const CurrentSpeakUserWindow: React.FC = () => {
|
||||||
const [inputValue, setInputValue] = useState('')
|
const [inputValue, setInputValue] = useState('')
|
||||||
|
const channel = new BroadcastChannel('meeting_channel');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
let time: NodeJS.Timeout;
|
||||||
|
time = setInterval(() => {
|
||||||
|
channel.postMessage({
|
||||||
|
type: 'currentSpeakUserWindowGetUserName'
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
window.electron.windowHandleMessageCallBack((_e: any, data: any) => {
|
window.electron.windowHandleMessageCallBack((_e: any, data: any) => {
|
||||||
if (data.parmes.currentSpeakUser.length) {
|
if (data.parmes.currentSpeakUser.length) {
|
||||||
setInputValue(data.parmes.currentSpeakUser.join(';'))
|
setInputValue(data.parmes.currentSpeakUser.join(';'))
|
||||||
|
|
@ -10,6 +17,9 @@ const CurrentSpeakUserWindow: React.FC = () => {
|
||||||
setInputValue('')
|
setInputValue('')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
return () => {
|
||||||
|
clearInterval(time)
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -374,30 +374,31 @@ const Meeting: React.FC = () => {
|
||||||
userId: noticeWindowPostRoomManager.uid
|
userId: noticeWindowPostRoomManager.uid
|
||||||
})
|
})
|
||||||
break;
|
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(() => {
|
time = setInterval(() => {
|
||||||
setCurrentSeconds(currentSeconds++)
|
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)
|
}, 1000)
|
||||||
// 首次加载图标更新
|
// 首次加载图标更新
|
||||||
const firstFooterList = [...footerList]
|
const firstFooterList = [...footerList]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue