From 90ba35da7a19939b967b84bfe5e2e6fb0f34241e Mon Sep 17 00:00:00 2001 From: Bruno Windels <274386+bwindels@users.noreply.github.com> Date: Thu, 26 Jan 2023 14:50:43 +0100 Subject: [PATCH] listen for members.size changes in CallTile and emit update so memberCount binding updates also be consistent to not emit updates on call object when changing members map --- src/domain/session/room/timeline/tiles/CallTile.js | 4 ++++ src/matrix/calls/group/GroupCall.ts | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/domain/session/room/timeline/tiles/CallTile.js b/src/domain/session/room/timeline/tiles/CallTile.js index 4583de49..ffb9ef59 100644 --- a/src/domain/session/room/timeline/tiles/CallTile.js +++ b/src/domain/session/room/timeline/tiles/CallTile.js @@ -30,6 +30,7 @@ export class CallTile extends SimpleTile { super(entry, options); const calls = this.getOption("session").callHandler.calls; this._callSubscription = undefined; + this._memberSizeSubscription = undefined; const call = calls.get(this._entry.stateKey); if (call && !call.isTerminated) { this._call = call; @@ -37,6 +38,9 @@ export class CallTile extends SimpleTile { this._callSubscription = this.track(this._call.disposableOn("change", () => { this._onCallUpdate(); })); + this._memberSizeSubscription = this.track(this._call.members.observeSize().subscribe(() => { + this.emitChange("memberCount"); + })); this._onCallUpdate(); } } diff --git a/src/matrix/calls/group/GroupCall.ts b/src/matrix/calls/group/GroupCall.ts index 7f9ba96e..e0099f4e 100644 --- a/src/matrix/calls/group/GroupCall.ts +++ b/src/matrix/calls/group/GroupCall.ts @@ -549,7 +549,6 @@ export class GroupCall extends EventEmitter<{change: never}> { member.dispose(); this._members.remove(memberKey); } - this.emitChange(); }); }