forked from mystiq/hydrogen-web
use disposeTracked
This commit is contained in:
parent
3feaf38252
commit
2a92363317
1 changed files with 3 additions and 7 deletions
|
@ -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 a new issue