Skip to content

Commit 8f9bee7

Browse files
committed
Don't show "waiting for media..." in case of local participant
1 parent 16666b8 commit 8f9bee7

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

src/tile/GridTile.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ const UserMediaTile = forwardRef<HTMLDivElement, UserMediaTileProps>(
175175
raisedHandTime={handRaised}
176176
currentReaction={currentReaction}
177177
raisedHandOnClick={raisedHandOnClick}
178+
localParticipant={vm.local}
178179
{...props}
179180
/>
180181
);

src/tile/MediaView.test.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe("MediaView", () => {
4242
unencryptedWarning: false,
4343
video: trackReference,
4444
member: undefined,
45+
localParticipant: false,
4546
};
4647

4748
test("is accessible", async () => {
@@ -60,8 +61,19 @@ describe("MediaView", () => {
6061
});
6162

6263
describe("with no participant", () => {
63-
it("shows avatar", () => {
64-
render(<MediaView {...baseProps} video={undefined} />);
64+
it("shows avatar for local user", () => {
65+
render(
66+
<MediaView {...baseProps} video={undefined} localParticipant={true} />,
67+
);
68+
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
69+
expect(screen.queryAllByText("video_tile.waiting_for_media").length).toBe(
70+
0,
71+
);
72+
});
73+
it("shows avatar and label for remote user", () => {
74+
render(
75+
<MediaView {...baseProps} video={undefined} localParticipant={false} />,
76+
);
6577
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
6678
expect(screen.getByText("video_tile.waiting_for_media")).toBeVisible();
6779
});

src/tile/MediaView.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ interface Props extends ComponentProps<typeof animated.div> {
4141
raisedHandTime?: Date;
4242
currentReaction?: ReactionOption;
4343
raisedHandOnClick?: () => void;
44+
localParticipant: boolean;
4445
}
4546

4647
export const MediaView = forwardRef<HTMLDivElement, Props>(
@@ -63,6 +64,7 @@ export const MediaView = forwardRef<HTMLDivElement, Props>(
6364
raisedHandTime,
6465
currentReaction,
6566
raisedHandOnClick,
67+
localParticipant,
6668
...props
6769
},
6870
ref,
@@ -118,7 +120,7 @@ export const MediaView = forwardRef<HTMLDivElement, Props>(
118120
/>
119121
)}
120122
</div>
121-
{!video && (
123+
{!video && !localParticipant && (
122124
<div className={styles.status}>
123125
{t("video_tile.waiting_for_media")}
124126
</div>

src/tile/SpotlightTile.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface SpotlightItemBaseProps {
5555
encryptionStatus: EncryptionStatus;
5656
displayName: string;
5757
"aria-hidden"?: boolean;
58+
localParticipant: boolean;
5859
}
5960

6061
interface SpotlightUserMediaItemBaseProps extends SpotlightItemBaseProps {
@@ -163,6 +164,7 @@ const SpotlightItem = forwardRef<HTMLDivElement, SpotlightItemProps>(
163164
displayName,
164165
encryptionStatus,
165166
"aria-hidden": ariaHidden,
167+
localParticipant: vm.local,
166168
};
167169

168170
return vm instanceof ScreenShareViewModel ? (

0 commit comments

Comments
 (0)