Skip to content

Commit

Permalink
fix: convert to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Mar 18, 2024
1 parent f59aaef commit f1d230d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>) => {
try {
// get current state from store and merge updated fields
const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
Expand All @@ -24,6 +24,7 @@ export const useMyMetadata = () => {
} catch (error) {
console.error('failed to update metadata ', updatedFields);
}
return false;
};

const toggleHandRaise = useCallback(async () => {
Expand All @@ -43,19 +44,12 @@ export const useMyMetadata = () => {
}
}, [metaData?.isBRBOn]); //eslint-disable-line

const setPrevRole = async role => {
await update({
prevRole: role,
});
};

return {
isHandRaised,
isBRBOn: !!metaData?.isBRBOn,
metaData,
updateMetaData: update,
toggleHandRaise,
toggleBRB,
setPrevRole,
};
};

0 comments on commit f1d230d

Please sign in to comment.