Skip to content

Commit 4e8d870

Browse files
committed
Update vm so that the listener is tracked through disposable
1 parent a48d308 commit 4e8d870

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/viewmodels/event-tiles/TextualEventViewModel.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,11 @@ export class TextualEventViewModel extends BaseViewModel<TextualEventViewSnapsho
1717
public constructor(props: EventTileTypeProps) {
1818
super(props, { content: "" });
1919
this.setTextFromEvent();
20+
this.disposables.trackListener(this.props.mxEvent, MatrixEventEvent.SentinelUpdated, this.setTextFromEvent);
2021
}
2122

2223
private setTextFromEvent = (): void => {
2324
const content = textForEvent(this.props.mxEvent, MatrixClientPeg.safeGet(), true, this.props.showHiddenEvents);
2425
this.snapshot.set({ content });
2526
};
26-
27-
protected addDownstreamSubscription = (): void => {
28-
this.props.mxEvent.on(MatrixEventEvent.SentinelUpdated, this.setTextFromEvent);
29-
};
30-
31-
protected removeDownstreamSubscription = (): void => {
32-
this.props.mxEvent.off(MatrixEventEvent.SentinelUpdated, this.setTextFromEvent);
33-
};
3427
}

0 commit comments

Comments
 (0)