mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-31 07:00:26 +00:00
Don't show "waiting for media..." in case of local participant
This commit is contained in:
@@ -175,6 +175,7 @@ const UserMediaTile = forwardRef<HTMLDivElement, UserMediaTileProps>(
|
||||
raisedHandTime={handRaised}
|
||||
currentReaction={currentReaction}
|
||||
raisedHandOnClick={raisedHandOnClick}
|
||||
localParticipant={vm.local}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -42,6 +42,7 @@ describe("MediaView", () => {
|
||||
unencryptedWarning: false,
|
||||
video: trackReference,
|
||||
member: undefined,
|
||||
localParticipant: false,
|
||||
};
|
||||
|
||||
test("is accessible", async () => {
|
||||
@@ -60,8 +61,19 @@ describe("MediaView", () => {
|
||||
});
|
||||
|
||||
describe("with no participant", () => {
|
||||
it("shows avatar", () => {
|
||||
render(<MediaView {...baseProps} video={undefined} />);
|
||||
it("shows avatar for local user", () => {
|
||||
render(
|
||||
<MediaView {...baseProps} video={undefined} localParticipant={true} />,
|
||||
);
|
||||
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
||||
expect(screen.queryAllByText("video_tile.waiting_for_media").length).toBe(
|
||||
0,
|
||||
);
|
||||
});
|
||||
it("shows avatar and label for remote user", () => {
|
||||
render(
|
||||
<MediaView {...baseProps} video={undefined} localParticipant={false} />,
|
||||
);
|
||||
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
||||
expect(screen.getByText("video_tile.waiting_for_media")).toBeVisible();
|
||||
});
|
||||
|
||||
@@ -41,6 +41,7 @@ interface Props extends ComponentProps<typeof animated.div> {
|
||||
raisedHandTime?: Date;
|
||||
currentReaction?: ReactionOption;
|
||||
raisedHandOnClick?: () => void;
|
||||
localParticipant: boolean;
|
||||
}
|
||||
|
||||
export const MediaView = forwardRef<HTMLDivElement, Props>(
|
||||
@@ -63,6 +64,7 @@ export const MediaView = forwardRef<HTMLDivElement, Props>(
|
||||
raisedHandTime,
|
||||
currentReaction,
|
||||
raisedHandOnClick,
|
||||
localParticipant,
|
||||
...props
|
||||
},
|
||||
ref,
|
||||
@@ -118,7 +120,7 @@ export const MediaView = forwardRef<HTMLDivElement, Props>(
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{!video && (
|
||||
{!video && !localParticipant && (
|
||||
<div className={styles.status}>
|
||||
{t("video_tile.waiting_for_media")}
|
||||
</div>
|
||||
|
||||
@@ -55,6 +55,7 @@ interface SpotlightItemBaseProps {
|
||||
encryptionStatus: EncryptionStatus;
|
||||
displayName: string;
|
||||
"aria-hidden"?: boolean;
|
||||
localParticipant: boolean;
|
||||
}
|
||||
|
||||
interface SpotlightUserMediaItemBaseProps extends SpotlightItemBaseProps {
|
||||
@@ -163,6 +164,7 @@ const SpotlightItem = forwardRef<HTMLDivElement, SpotlightItemProps>(
|
||||
displayName,
|
||||
encryptionStatus,
|
||||
"aria-hidden": ariaHidden,
|
||||
localParticipant: vm.local,
|
||||
};
|
||||
|
||||
return vm instanceof ScreenShareViewModel ? (
|
||||
|
||||
Reference in New Issue
Block a user