diff --git a/src/components/JoinSetting/index.tsx b/src/components/JoinSetting/index.tsx index 18065db..e8be5b5 100644 --- a/src/components/JoinSetting/index.tsx +++ b/src/components/JoinSetting/index.tsx @@ -20,18 +20,17 @@ const JoinSetting = forwardRef((_props: any, ref: any) => { if (location.hash.indexOf('/meeting') === -1) { await agora.init() } - setJoinRoomSettingForm((res: any) => { - res.forEach(async (item: any, index: number) => { - if (index === 0 && role.ID.includes(userInfo.roleId)) { - await agora.getAudioMediaList().then(res => { - item.active = res.ecordingList.length ? true : false - }) - } else { - item.active = false - } - }); - return res - }) + const list = [...joinRoomSettingForm] + list.forEach(async (item: any, index: number) => { + if (index === 0 && role.ID.includes(userInfo.roleId)) { + await agora.getAudioMediaList().then(res => { + item.active = res.ecordingList.length ? true : false + }) + } else { + item.active = false + } + }); + setJoinRoomSettingForm(list) setRoomNumber(roomNum) getDeviceList() }