From 59ebcf99fbd1fc1c3f4cfdae50f9e0bf78c01529 Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:56:30 +0100 Subject: [PATCH] use observeSize to emit update on memberCount rather than custom handler --- .../toast/CallToastNotificationViewModel.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/domain/session/toast/CallToastNotificationViewModel.ts b/src/domain/session/toast/CallToastNotificationViewModel.ts index 3281b86a..5c788334 100644 --- a/src/domain/session/toast/CallToastNotificationViewModel.ts +++ b/src/domain/session/toast/CallToastNotificationViewModel.ts @@ -34,22 +34,9 @@ type MinimumNeededSegmentType = { export class CallToastNotificationViewModel = Options> extends BaseToastNotificationViewModel implements IAvatarContract { constructor(options: O) { super(options); - this.track( - this.call.members.subscribe({ - onAdd: (_, __) => { - this.emitChange("memberCount"); - }, - onUpdate: (_, __) => { - this.emitChange("memberCount"); - }, - onRemove: (_, __) => { - this.emitChange("memberCount"); - }, - onReset: () => { - this.emitChange("memberCount"); - }, - }) - ); + this.track(this.call.members.observeSize().subscribe(() => { + this.emitChange("memberCount"); + })); // Dismiss the toast if the room is opened manually this.track( this.navigation.observe("room").subscribe((roomId) => {