mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
use disposeTracked
This commit is contained in:
parent
3feaf38252
commit
2a92363317
@ -27,13 +27,9 @@ export class ComposerViewModel extends ViewModel {
|
|||||||
setReplyingTo(entry) {
|
setReplyingTo(entry) {
|
||||||
const changed = this._replyVM?.internalId !== entry?.asEventKey().toString();
|
const changed = this._replyVM?.internalId !== entry?.asEventKey().toString();
|
||||||
if (changed) {
|
if (changed) {
|
||||||
if (this._replyVM) {
|
this._replyVM = this.disposeTracked(this._replyVM);
|
||||||
this.untrack(this._replyVM);
|
if (entry) {
|
||||||
this._replyVM.dispose();
|
this._replyVM = this.track(this._roomVM._createTile(entry));
|
||||||
}
|
|
||||||
this._replyVM = entry && this._roomVM._createTile(entry);
|
|
||||||
if (this._replyVM) {
|
|
||||||
this.track(this._replyVM);
|
|
||||||
}
|
}
|
||||||
this.emitChange("replyViewModel");
|
this.emitChange("replyViewModel");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user