Remove isLiveKitParticipantAvailable and show via encryption status

This commit is contained in:
Hugh Nimmo-Smith 2024-11-07 17:53:08 +00:00
parent 5009f1fe1b
commit 238797aed8
2 changed files with 5 additions and 18 deletions

View File

@ -215,9 +215,6 @@ abstract class BaseMediaViewModel extends ViewModel {
*/ */
public readonly unencryptedWarning: Observable<boolean>; public readonly unencryptedWarning: Observable<boolean>;
public readonly isLiveKitParticipantAvailable: Observable<boolean> =
this.participant.pipe(map((p) => !!p));
public readonly encryptionStatus: Observable<EncryptionStatus>; public readonly encryptionStatus: Observable<EncryptionStatus>;
public constructor( public constructor(
@ -231,7 +228,7 @@ abstract class BaseMediaViewModel extends ViewModel {
// TODO: Fully separate the data layer from the UI layer by keeping the // TODO: Fully separate the data layer from the UI layer by keeping the
// member object internal // member object internal
public readonly member: RoomMember | undefined, public readonly member: RoomMember | undefined,
// We dont necessarily have a participant if a user connects via MatrixRTC but not (not yet) through // We don't necessarily have a participant if a user connects via MatrixRTC but not (yet) through
// livekit. // livekit.
protected readonly participant: Observable< protected readonly participant: Observable<
LocalParticipant | RemoteParticipant | undefined LocalParticipant | RemoteParticipant | undefined
@ -259,8 +256,9 @@ abstract class BaseMediaViewModel extends ViewModel {
this.encryptionStatus = this.participant.pipe( this.encryptionStatus = this.participant.pipe(
switchMap((participant): Observable<EncryptionStatus> => { switchMap((participant): Observable<EncryptionStatus> => {
if ( if (!participant) {
!participant || return of(EncryptionStatus.Connecting);
} else if (
participant.isLocal || participant.isLocal ||
encryptionSystem.kind === E2eeType.NONE encryptionSystem.kind === E2eeType.NONE
) { ) {

View File

@ -86,9 +86,6 @@ const UserMediaTile = forwardRef<HTMLDivElement, UserMediaTileProps>(
const videoEnabled = useObservableEagerState(vm.videoEnabled); const videoEnabled = useObservableEagerState(vm.videoEnabled);
const speaking = useObservableEagerState(vm.speaking); const speaking = useObservableEagerState(vm.speaking);
const cropVideo = useObservableEagerState(vm.cropVideo); const cropVideo = useObservableEagerState(vm.cropVideo);
const isLiveKitParticipantAvailable = useObservableEagerState(
vm.isLiveKitParticipantAvailable,
);
const onSelectFitContain = useCallback( const onSelectFitContain = useCallback(
(e: Event) => { (e: Event) => {
e.preventDefault(); e.preventDefault();
@ -142,12 +139,7 @@ const UserMediaTile = forwardRef<HTMLDivElement, UserMediaTileProps>(
className={styles.muteIcon} className={styles.muteIcon}
/> />
} }
displayName={ displayName={displayName}
displayName +
(isLiveKitParticipantAvailable
? ""
: " missing Livekit Participant...")
}
primaryButton={ primaryButton={
<Menu <Menu
open={menuOpen} open={menuOpen}
@ -263,9 +255,6 @@ const RemoteUserMediaTile = forwardRef<
mirror={false} mirror={false}
menuStart={ menuStart={
<> <>
{/* {isLiveKitParticipantAvailable
? "is available"
: "Loading RTC participant"} */}
<ToggleMenuItem <ToggleMenuItem
Icon={MicOffIcon} Icon={MicOffIcon}
label={t("video_tile.mute_for_me")} label={t("video_tile.mute_for_me")}