mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-19 16:51:40 +01:00
Check if options exist in emitChange
This commit is contained in:
parent
61b264be3b
commit
498a43327f
@ -110,7 +110,7 @@ export class ViewModel<O extends Options = Options> extends EventEmitter<{change
|
|||||||
}
|
}
|
||||||
|
|
||||||
emitChange(changedProps: any): void {
|
emitChange(changedProps: any): void {
|
||||||
if (this._options.emitChange) {
|
if (this._options?.emitChange) {
|
||||||
this._options.emitChange(changedProps);
|
this._options.emitChange(changedProps);
|
||||||
} else {
|
} else {
|
||||||
this.emit("change", changedProps);
|
this.emit("change", changedProps);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user