{reactionsIcons?.map(({ sender, emoji, startX }) => (
diff --git a/src/state/CallViewModel.test.ts b/src/state/CallViewModel.test.ts
index 88e4d317f..3c83ea099 100644
--- a/src/state/CallViewModel.test.ts
+++ b/src/state/CallViewModel.test.ts
@@ -194,7 +194,7 @@ function withCallViewModel(
speaking: Map
>,
continuation: (
vm: CallViewModel,
- subjects: { raisedHands: BehaviorSubject> },
+ subjects: { raisedHands$: BehaviorSubject> },
) => void,
): void {
const room = mockMatrixRoom({
@@ -240,7 +240,7 @@ function withCallViewModel(
{ remoteParticipants$ },
);
- const raisedHands = new BehaviorSubject>({});
+ const raisedHands$ = new BehaviorSubject>({});
const vm = new CallViewModel(
rtcSession as unknown as MatrixRTCSession,
@@ -249,7 +249,7 @@ function withCallViewModel(
kind: E2eeType.PER_PARTICIPANT,
},
connectionState$,
- raisedHands,
+ raisedHands$,
new BehaviorSubject({}),
);
@@ -261,7 +261,7 @@ function withCallViewModel(
roomEventSelectorSpy!.mockRestore();
});
- continuation(vm, { raisedHands });
+ continuation(vm, { raisedHands$: raisedHands$ });
}
test("participants are retained during a focus switch", () => {
@@ -802,7 +802,7 @@ it("should rank raised hands above video feeds and below speakers and presenters
of([aliceRtcMember, bobRtcMember]),
of(ConnectionState.Connected),
new Map(),
- (vm, { raisedHands }) => {
+ (vm, { raisedHands$ }) => {
schedule("ab", {
a: () => {
// We imagine that only three tiles (the first three) will be visible
@@ -814,7 +814,7 @@ it("should rank raised hands above video feeds and below speakers and presenters
});
},
b: () => {
- raisedHands.next({
+ raisedHands$.next({
[`${bobRtcMember.sender}:${bobRtcMember.deviceId}`]: {
time: new Date(),
reactionEventId: "",
diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts
index bb2757788..fb8c0a5d4 100644
--- a/src/state/CallViewModel.ts
+++ b/src/state/CallViewModel.ts
@@ -258,8 +258,8 @@ class UserMedia {
participant: LocalParticipant | RemoteParticipant | undefined,
encryptionSystem: EncryptionSystem,
livekitRoom: LivekitRoom,
- handRaised: Observable,
- reaction: Observable,
+ handRaised$: Observable,
+ reaction$: Observable,
) {
this.participant$ = new BehaviorSubject(participant);
@@ -270,8 +270,8 @@ class UserMedia {
this.participant$.asObservable() as Observable,
encryptionSystem,
livekitRoom,
- handRaised,
- reaction,
+ handRaised$,
+ reaction$,
);
} else {
this.vm = new RemoteUserMediaViewModel(
@@ -282,8 +282,8 @@ class UserMedia {
>,
encryptionSystem,
livekitRoom,
- handRaised,
- reaction,
+ handRaised$,
+ reaction$,
);
}
@@ -544,10 +544,10 @@ export class CallViewModel extends ViewModel {
participant,
this.encryptionSystem,
this.livekitRoom,
- this.handsRaised.pipe(
+ this.handsRaised$.pipe(
map((v) => v[matrixIdentifier]?.time ?? null),
),
- this.reactions.pipe(
+ this.reactions$.pipe(
map((v) => v[matrixIdentifier] ?? undefined),
),
),
@@ -711,7 +711,7 @@ export class CallViewModel extends ViewModel {
m.speaker$,
m.presenter$,
m.vm.videoEnabled$,
- m.vm.handRaised,
+ m.vm.handRaised$,
m.vm instanceof LocalUserMediaViewModel
? m.vm.alwaysShow$
: of(false),
@@ -1203,7 +1203,7 @@ export class CallViewModel extends ViewModel {
this.scope.state(),
);
- public readonly reactions = this.reactionsSubject.pipe(
+ public readonly reactions$ = this.reactionsSubject$.pipe(
map((v) =>
Object.fromEntries(
Object.entries(v).map(([a, { reactionOption }]) => [a, reactionOption]),
@@ -1211,13 +1211,13 @@ export class CallViewModel extends ViewModel {
),
);
- public readonly handsRaised = this.handsRaisedSubject.pipe();
+ public readonly handsRaised$ = this.handsRaisedSubject$.pipe();
/**
* Emits an array of reactions that should be visible on the screen.
*/
- public readonly visibleReactions = showReactions.value$
- .pipe(switchMap((show) => (show ? this.reactions : of({}))))
+ public readonly visibleReactions$ = showReactions.value$
+ .pipe(switchMap((show) => (show ? this.reactions$ : of({}))))
.pipe(
scan<
Record,
@@ -1238,10 +1238,10 @@ export class CallViewModel extends ViewModel {
/**
* Emits an array of reactions that should be played.
*/
- public readonly audibleReactions = playReactionsSound.value$
+ public readonly audibleReactions$ = playReactionsSound.value$
.pipe(
switchMap((show) =>
- show ? this.reactions : of>({}),
+ show ? this.reactions$ : of>({}),
),
)
.pipe(
@@ -1267,7 +1267,7 @@ export class CallViewModel extends ViewModel {
* Emits an event every time a new hand is raised in
* the call.
*/
- public readonly newHandRaised = this.handsRaised.pipe(
+ public readonly newHandRaised$ = this.handsRaised$.pipe(
map((v) => Object.keys(v).length),
scan(
(acc, newValue) => ({
@@ -1285,10 +1285,12 @@ export class CallViewModel extends ViewModel {
private readonly livekitRoom: LivekitRoom,
private readonly encryptionSystem: EncryptionSystem,
private readonly connectionState$: Observable,
- private readonly handsRaisedSubject: Observable<
+ private readonly handsRaisedSubject$: Observable<
Record
>,
- private readonly reactionsSubject: Observable>,
+ private readonly reactionsSubject$: Observable<
+ Record
+ >,
) {
super();
}
diff --git a/src/state/MediaViewModel.ts b/src/state/MediaViewModel.ts
index ebb615494..b57b6f15c 100644
--- a/src/state/MediaViewModel.ts
+++ b/src/state/MediaViewModel.ts
@@ -372,8 +372,8 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
participant$: Observable,
encryptionSystem: EncryptionSystem,
livekitRoom: LivekitRoom,
- public readonly handRaised: Observable,
- public readonly reaction: Observable,
+ public readonly handRaised$: Observable,
+ public readonly reaction$: Observable,
) {
super(
id,
@@ -440,8 +440,8 @@ export class LocalUserMediaViewModel extends BaseUserMediaViewModel {
participant$: Observable,
encryptionSystem: EncryptionSystem,
livekitRoom: LivekitRoom,
- handRaised: Observable,
- reaction: Observable,
+ handRaised$: Observable,
+ reaction$: Observable,
) {
super(
id,
@@ -449,8 +449,8 @@ export class LocalUserMediaViewModel extends BaseUserMediaViewModel {
participant$,
encryptionSystem,
livekitRoom,
- handRaised,
- reaction,
+ handRaised$,
+ reaction$,
);
}
}
@@ -511,8 +511,8 @@ export class RemoteUserMediaViewModel extends BaseUserMediaViewModel {
participant$: Observable,
encryptionSystem: EncryptionSystem,
livekitRoom: LivekitRoom,
- handRaised: Observable,
- reaction: Observable,
+ handRaised$: Observable,
+ reaction$: Observable,
) {
super(
id,
@@ -520,8 +520,8 @@ export class RemoteUserMediaViewModel extends BaseUserMediaViewModel {
participant$,
encryptionSystem,
livekitRoom,
- handRaised,
- reaction,
+ handRaised$,
+ reaction$,
);
// Sync the local volume with LiveKit
diff --git a/src/tile/GridTile.test.tsx b/src/tile/GridTile.test.tsx
index 1c71c17b9..16875c332 100644
--- a/src/tile/GridTile.test.tsx
+++ b/src/tile/GridTile.test.tsx
@@ -53,8 +53,8 @@ test("GridTile is accessible", async () => {
memberships: [],
} as unknown as MatrixRTCSession;
const cVm = {
- reactions: of({}),
- handsRaised: of({}),
+ reactions$: of({}),
+ handsRaised$: of({}),
} as Partial as CallViewModel;
const { container } = render(
diff --git a/src/tile/GridTile.tsx b/src/tile/GridTile.tsx
index b37bc85c6..9eb775d02 100644
--- a/src/tile/GridTile.tsx
+++ b/src/tile/GridTile.tsx
@@ -97,8 +97,8 @@ const UserMediaTile = forwardRef(
},
[vm],
);
- const handRaised = useObservableState(vm.handRaised);
- const reaction = useObservableState(vm.reaction);
+ const handRaised = useObservableState(vm.handRaised$);
+ const reaction = useObservableState(vm.reaction$);
const AudioIcon = locallyMuted
? VolumeOffSolidIcon
diff --git a/src/utils/test-viewmodel.ts b/src/utils/test-viewmodel.ts
index 6f69cde60..5b53419e6 100644
--- a/src/utils/test-viewmodel.ts
+++ b/src/utils/test-viewmodel.ts
@@ -66,17 +66,17 @@ export function getBasicCallViewModelEnvironment(
roomId: matrixRoomId,
});
- const remoteRtcMemberships = new BehaviorSubject(
+ const remoteRtcMemberships$ = new BehaviorSubject(
initialRemoteRtcMemberships,
);
- const handRaisedSubject = new BehaviorSubject({});
- const reactionsSubject = new BehaviorSubject({});
+ const handRaisedSubject$ = new BehaviorSubject({});
+ const reactionsSubject$ = new BehaviorSubject({});
const rtcSession = new MockRTCSession(
matrixRoom,
localRtcMember,
- ).withMemberships(remoteRtcMemberships);
+ ).withMemberships(remoteRtcMemberships$);
const vm = new CallViewModel(
rtcSession as unknown as MatrixRTCSession,
@@ -85,14 +85,14 @@ export function getBasicCallViewModelEnvironment(
kind: E2eeType.PER_PARTICIPANT,
},
of(ConnectionState.Connected),
- handRaisedSubject,
- reactionsSubject,
+ handRaisedSubject$,
+ reactionsSubject$,
);
return {
vm,
- remoteRtcMemberships$: remoteRtcMemberships,
+ remoteRtcMemberships$: remoteRtcMemberships$,
rtcSession,
- handRaisedSubject$: handRaisedSubject,
- reactionsSubject$: reactionsSubject,
+ handRaisedSubject$: handRaisedSubject$,
+ reactionsSubject$: reactionsSubject$,
};
}