Skip to content

Commit 0bb81df

Browse files
authored
[Bugfix] Remove unreachable code (#5520)
1 parent a5f8964 commit 0bb81df

17 files changed

+18
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Remove unreachable code",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Remove unreachable code",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-component-bindings/src/handlers/createHandlers.ts

-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { _toCommunicationIdentifier } from '@internal/acs-ui-common';
1515
import { DeclarativeCallAgent } from '@internal/calling-stateful-client';
1616
import { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';
1717
import memoizeOne from 'memoize-one';
18-
import { isACSCallParticipants } from '../utils/callUtils';
1918
import { createLocalVideoStream } from '../utils/callUtils';
2019
import { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';
2120

@@ -83,10 +82,6 @@ export const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoiz
8382
// FIXME: onStartCall API should use string, not the underlying SDK types.
8483
onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {
8584
return callAgent?.startCall(participants, options);
86-
if (!isACSCallParticipants(participants)) {
87-
throw new Error('TeamsUserIdentifier in Teams call is not supported!');
88-
}
89-
return callAgent?.startCall(participants, options);
9085
},
9186
onAddParticipant: async (
9287
userId: string | CommunicationIdentifier,

packages/calling-component-bindings/src/participantListSelector.ts

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ const convertRemoteParticipantsToParticipantListParticipants = (
4343
// Filter out MicrosoftBot participants
4444
.filter((participant: RemoteParticipantState) => {
4545
return !isMicrosoftTeamsAppIdentifier(participant.identifier);
46-
return true;
4746
})
4847
/**
4948
* hiding participants who are inLobby, idle, or connecting in ACS clients till we can admit users through ACS clients.

packages/react-components/src/components/ChatMessage/ChatMessageContent.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ export const getAttachmentCountLiveMessage = (
244244
return _formatString(attachmentCardGroupMessage, {
245245
attachmentCount: `${attachments.length}`
246246
});
247-
return '';
248247
};
249248

250249
const defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {

packages/react-components/src/components/LocalVideoTile.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ export const _LocalVideoTile = React.memo(
154154
return {
155155
contextualMenu: contextualMenuProps
156156
};
157-
return {};
158157
}, [contextualMenuProps, menuKind]);
159158

160159
const videoTileStyles = useMemo(() => {

packages/react-components/src/components/VideoGallery.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,6 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {
508508

509509
const showDisplayNameTrampoline = (): string => {
510510
return layout === 'default' ? strings.localVideoLabel : isNarrow ? '' : strings.localVideoLabel;
511-
return isNarrow ? '' : strings.localVideoLabel;
512511
};
513512

514513
return (

packages/react-components/src/components/VideoGallery/DefaultLayout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,4 @@ const overflowGalleryTrampoline = (
150150
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
151151
): JSX.Element | null => {
152152
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
153-
return gallery;
154153
};

packages/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,4 @@ const overflowGalleryTrampoline = (
240240
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
241241
): JSX.Element | null => {
242242
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
243-
return gallery;
244243
};

packages/react-components/src/components/VideoGallery/SpeakerVideoLayout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,4 @@ const overflowGalleryTrampoline = (
208208
galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'
209209
): JSX.Element | null => {
210210
return galleryPosition !== 'horizontalTop' ? gallery : <></>;
211-
return gallery;
212211
};

packages/react-components/src/components/utils/ChatMessageComponentUtils.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ const defaultOnRenderAttachmentDownloads = (
103103
) : (
104104
<></>
105105
);
106-
return undefined;
107106
};
108107

109108
/** @private */

packages/react-composites/src/composites/CallComposite/components/CallArrangement.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
345345
onStopAllSpotlight: hideSpotlightButtons ? undefined : stopAllSpotlightWithPrompt,
346346
maxParticipantsToSpotlight
347347
};
348-
return {};
349348
}, [
350349
hideSpotlightButtons,
351350
maxParticipantsToSpotlight,

packages/react-composites/src/composites/CallComposite/components/MediaGallery.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ export const MediaGallery = (props: MediaGalleryProps): JSX.Element => {
189189
const VideoGalleryMemoized = useMemo(() => {
190190
const layoutBasedOnUserSelection = (): VideoGalleryLayout => {
191191
return props.localVideoTileOptions ? layoutBasedOnTilePosition : props.userSetGalleryLayout;
192-
return layoutBasedOnTilePosition;
193192
};
194193

195194
return (

packages/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const ScreenShare = (props: {
2424

2525
const screenShareButtonDisabled = (): boolean => {
2626
return screenShareButtonProps?.disabled ?? isDisabled(props.option);
27-
return isDisabled(props.option);
2827
};
2928

3029
return (

packages/react-composites/src/composites/common/CallingDialpad.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ export const CallingDialpad = (props: CallingDialpadProps): JSX.Element => {
8484
/>
8585
</>
8686
);
87-
88-
return <></>;
8987
};
9088

9189
if (isMobile) {

packages/react-composites/src/composites/common/PeoplePaneContent.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export const PeoplePaneContent = (props: {
5252
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
5353
const getStrings = () => {
5454
return localeStrings.strings.call;
55-
56-
return localeStrings.strings.callWithChat;
5755
};
5856
const strings = getStrings();
5957

packages/react-composites/src/composites/common/VideoEffectsPane.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ const VideoEffectsPaneTrampoline = (
198198
/>
199199
</Stack>
200200
);
201-
return <></>;
202201
};
203202

204203
const backgroundPickerStyles = {

0 commit comments

Comments
 (0)