Skip to content

Commit

Permalink
[Bugfix] Remove unreachable code (#5520)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchou-dev authored Jan 7, 2025
1 parent a5f8964 commit 0bb81df
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Remove unreachable code",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Remove unreachable code",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { _toCommunicationIdentifier } from '@internal/acs-ui-common';
import { DeclarativeCallAgent } from '@internal/calling-stateful-client';
import { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';
import memoizeOne from 'memoize-one';
import { isACSCallParticipants } from '../utils/callUtils';
import { createLocalVideoStream } from '../utils/callUtils';
import { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';

Expand Down Expand Up @@ -83,10 +82,6 @@ export const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoiz
// FIXME: onStartCall API should use string, not the underlying SDK types.
onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {
return callAgent?.startCall(participants, options);
if (!isACSCallParticipants(participants)) {
throw new Error('TeamsUserIdentifier in Teams call is not supported!');
}
return callAgent?.startCall(participants, options);
},
onAddParticipant: async (
userId: string | CommunicationIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const convertRemoteParticipantsToParticipantListParticipants = (
// Filter out MicrosoftBot participants
.filter((participant: RemoteParticipantState) => {
return !isMicrosoftTeamsAppIdentifier(participant.identifier);
return true;
})
/**
* hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ export const getAttachmentCountLiveMessage = (
return _formatString(attachmentCardGroupMessage, {
attachmentCount: `${attachments.length}`
});
return '';
};

const defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export const _LocalVideoTile = React.memo(
return {
contextualMenu: contextualMenuProps
};
return {};
}, [contextualMenuProps, menuKind]);

const videoTileStyles = useMemo(() => {
Expand Down
1 change: 0 additions & 1 deletion packages/react-components/src/components/VideoGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {

const showDisplayNameTrampoline = (): string => {
return layout === 'default' ? strings.localVideoLabel : isNarrow ? '' : strings.localVideoLabel;
return isNarrow ? '' : strings.localVideoLabel;
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,4 @@ const overflowGalleryTrampoline = (
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
): JSX.Element | null => {
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
return gallery;
};
Original file line number Diff line number Diff line change
Expand Up @@ -240,5 +240,4 @@ const overflowGalleryTrampoline = (
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
): JSX.Element | null => {
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
return gallery;
};
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,4 @@ const overflowGalleryTrampoline = (
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
): JSX.Element | null => {
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
return gallery;
};
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const defaultOnRenderAttachmentDownloads = (
) : (
<></>
);
return undefined;
};

/** @private */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
onStopAllSpotlight: hideSpotlightButtons ? undefined : stopAllSpotlightWithPrompt,
maxParticipantsToSpotlight
};
return {};
}, [
hideSpotlightButtons,
maxParticipantsToSpotlight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
const VideoGalleryMemoized = useMemo(() => {
const layoutBasedOnUserSelection = (): VideoGalleryLayout => {
return props.localVideoTileOptions ? layoutBasedOnTilePosition : props.userSetGalleryLayout;
return layoutBasedOnTilePosition;
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const ScreenShare = (props: {

const screenShareButtonDisabled = (): boolean => {
return screenShareButtonProps?.disabled ?? isDisabled(props.option);
return isDisabled(props.option);
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ export const CallingDialpad = (props: CallingDialpadProps): JSX.Element => {
/>
</>
);

return <></>;
};

if (isMobile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ export const PeoplePaneContent = (props: {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const getStrings = () => {
return localeStrings.strings.call;

return localeStrings.strings.callWithChat;
};
const strings = getStrings();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ const VideoEffectsPaneTrampoline = (
/>
</Stack>
);
return <></>;
};

const backgroundPickerStyles = {
Expand Down

0 comments on commit 0bb81df

Please sign in to comment.