mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 07:31:38 +01:00
use observeSize to emit update on memberCount rather than custom handler
This commit is contained in:
parent
725757e235
commit
59ebcf99fb
@ -34,22 +34,9 @@ type MinimumNeededSegmentType = {
|
|||||||
export class CallToastNotificationViewModel<N extends MinimumNeededSegmentType = SegmentType, O extends Options<N> = Options<N>> extends BaseToastNotificationViewModel<N, O> implements IAvatarContract {
|
export class CallToastNotificationViewModel<N extends MinimumNeededSegmentType = SegmentType, O extends Options<N> = Options<N>> extends BaseToastNotificationViewModel<N, O> implements IAvatarContract {
|
||||||
constructor(options: O) {
|
constructor(options: O) {
|
||||||
super(options);
|
super(options);
|
||||||
this.track(
|
this.track(this.call.members.observeSize().subscribe(() => {
|
||||||
this.call.members.subscribe({
|
this.emitChange("memberCount");
|
||||||
onAdd: (_, __) => {
|
}));
|
||||||
this.emitChange("memberCount");
|
|
||||||
},
|
|
||||||
onUpdate: (_, __) => {
|
|
||||||
this.emitChange("memberCount");
|
|
||||||
},
|
|
||||||
onRemove: (_, __) => {
|
|
||||||
this.emitChange("memberCount");
|
|
||||||
},
|
|
||||||
onReset: () => {
|
|
||||||
this.emitChange("memberCount");
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
// Dismiss the toast if the room is opened manually
|
// Dismiss the toast if the room is opened manually
|
||||||
this.track(
|
this.track(
|
||||||
this.navigation.observe("room").subscribe((roomId) => {
|
this.navigation.observe("room").subscribe((roomId) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user