From f1d230d53ee8e1f5e33d06b4a409b9ab88732022 Mon Sep 17 00:00:00 2001 From: KaustubhKumar05 Date: Mon, 18 Mar 2024 15:12:22 +0530 Subject: [PATCH] fix: convert to ts --- .../MoreSettings/SplitComponents/DesktopOptions.tsx | 1 - .../MoreSettings/SplitComponents/MwebOptions.tsx | 1 - .../src/Prebuilt/components/PreviousRoleInMetadata.tsx | 1 - .../src/Prebuilt/components/RaiseHand.tsx | 1 - .../RoleChangeRequest/RoleChangeRequestModal.tsx | 1 - .../hooks/{useMetadata.jsx => useMetadata.tsx} | 10 ++-------- 6 files changed, 2 insertions(+), 13 deletions(-) rename packages/roomkit-react/src/Prebuilt/components/hooks/{useMetadata.jsx => useMetadata.tsx} (91%) diff --git a/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx b/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx index 697f30e7cd..2ade46c99d 100644 --- a/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx @@ -29,7 +29,6 @@ import { FullScreenItem } from '../FullScreenItem'; import { MuteAllModal } from '../MuteAllModal'; // @ts-ignore: No implicit any import { useDropdownList } from '../../hooks/useDropdownList'; -// @ts-ignore: No implicit any import { useMyMetadata } from '../../hooks/useMetadata'; // @ts-ignore: No implicit any import { APP_DATA, isMacOS } from '../../../common/constants'; diff --git a/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx b/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx index ec0353cf33..30cb6393fb 100644 --- a/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx @@ -50,7 +50,6 @@ import { usePollViewToggle, useSidepaneToggle } from '../../AppData/useSidepane' import { useShowPolls } from '../../AppData/useUISettings'; // @ts-ignore: No implicit any import { useDropdownList } from '../../hooks/useDropdownList'; -// @ts-ignore: No implicit any import { useMyMetadata } from '../../hooks/useMetadata'; import { useUnreadPollQuizPresent } from '../../hooks/useUnreadPollQuizPresent'; import { useLandscapeHLSStream, useMobileHLSStream } from '../../../common/hooks'; diff --git a/packages/roomkit-react/src/Prebuilt/components/PreviousRoleInMetadata.tsx b/packages/roomkit-react/src/Prebuilt/components/PreviousRoleInMetadata.tsx index 110aa7d7b4..c94fd0daa5 100644 --- a/packages/roomkit-react/src/Prebuilt/components/PreviousRoleInMetadata.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/PreviousRoleInMetadata.tsx @@ -1,6 +1,5 @@ import { useEffect } from 'react'; import { selectLocalPeerRoleName, useHMSVanillaStore } from '@100mslive/react-sdk'; -// @ts-ignore: No implicit Any import { useMyMetadata } from './hooks/useMetadata'; export const PreviousRoleInMetadata = () => { diff --git a/packages/roomkit-react/src/Prebuilt/components/RaiseHand.tsx b/packages/roomkit-react/src/Prebuilt/components/RaiseHand.tsx index 94417e9942..e3b61f45b1 100644 --- a/packages/roomkit-react/src/Prebuilt/components/RaiseHand.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/RaiseHand.tsx @@ -4,7 +4,6 @@ import { CSS } from '../../Theme'; import { Tooltip } from '../../Tooltip'; // @ts-ignore: No implicit Any import IconButton from '../IconButton'; -// @ts-ignore: No implicit Any import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; import { useMyMetadata } from './hooks/useMetadata'; diff --git a/packages/roomkit-react/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx b/packages/roomkit-react/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx index 95527ab790..c8fe885f9e 100644 --- a/packages/roomkit-react/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx +++ b/packages/roomkit-react/src/Prebuilt/components/RoleChangeRequest/RoleChangeRequestModal.tsx @@ -13,7 +13,6 @@ import { Flex, Text } from '../../..'; import { PreviewControls, PreviewTile } from '../Preview/PreviewJoin'; import { RequestPrompt } from './RequestPrompt'; import { useRoomLayoutPreviewScreen } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen'; -// @ts-ignore: No implicit Any import { useMyMetadata } from '../hooks/useMetadata'; // @ts-ignore: No implicit Any import { ROLE_CHANGE_DECLINED } from '../../common/constants'; diff --git a/packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.jsx b/packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.tsx similarity index 91% rename from packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.jsx rename to packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.tsx index 0057cfb309..5f32c6c52a 100644 --- a/packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/hooks/useMetadata.tsx @@ -15,7 +15,7 @@ export const useMyMetadata = () => { const metaData = useHMSStore(selectPeerMetadata(localPeerId)); const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId)); - const update = async updatedFields => { + const update = async (updatedFields: Record) => { try { // get current state from store and merge updated fields const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId)); @@ -24,6 +24,7 @@ export const useMyMetadata = () => { } catch (error) { console.error('failed to update metadata ', updatedFields); } + return false; }; const toggleHandRaise = useCallback(async () => { @@ -43,12 +44,6 @@ export const useMyMetadata = () => { } }, [metaData?.isBRBOn]); //eslint-disable-line - const setPrevRole = async role => { - await update({ - prevRole: role, - }); - }; - return { isHandRaised, isBRBOn: !!metaData?.isBRBOn, @@ -56,6 +51,5 @@ export const useMyMetadata = () => { updateMetaData: update, toggleHandRaise, toggleBRB, - setPrevRole, }; };