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
This commit is contained in:
Bruno Windels 2023-01-26 14:50:43 +01:00
parent 38d5a4412b
commit 90ba35da7a
2 changed files with 4 additions and 1 deletions

View File

@ -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();
}
}

View File

@ -549,7 +549,6 @@ export class GroupCall extends EventEmitter<{change: never}> {
member.dispose();
this._members.remove(memberKey);
}
this.emitChange();
});
}