changes signature of emitChange to require changedProps
This commit is contained in:
parent
7b7b19476c
commit
aeed978789
3 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
import {Client} from "../matrix/Client.js";
|
import {Client} from "../matrix/Client.js";
|
||||||
import {SessionViewModel} from "./session/SessionViewModel.js";
|
import {SessionViewModel} from "./session/SessionViewModel.js";
|
||||||
import {SessionLoadViewModel} from "./SessionLoadViewModel.js";
|
import {SessionLoadViewModel} from "./SessionLoadViewModel.js";
|
||||||
import {LoginViewModel} from "./login/LoginViewModel.ts";
|
import {LoginViewModel} from "./login/LoginViewModel";
|
||||||
import {LogoutViewModel} from "./LogoutViewModel";
|
import {LogoutViewModel} from "./LogoutViewModel";
|
||||||
import {SessionPickerViewModel} from "./SessionPickerViewModel.js";
|
import {SessionPickerViewModel} from "./SessionPickerViewModel.js";
|
||||||
import {ViewModel} from "./ViewModel";
|
import {ViewModel} from "./ViewModel";
|
||||||
|
|
|
@ -115,7 +115,7 @@ export class ViewModel<O extends Options = Options> extends EventEmitter<{change
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
|
|
|
@ -208,7 +208,7 @@ export class LoginViewModel extends ViewModel<Options> {
|
||||||
this._showError("");
|
this._showError("");
|
||||||
this._disposeViewModels();
|
this._disposeViewModels();
|
||||||
this._abortQueryOperation = this.disposeTracked(this._abortQueryOperation);
|
this._abortQueryOperation = this.disposeTracked(this._abortQueryOperation);
|
||||||
this.emitChange(); // multiple fields changing
|
this.emitChange("loginViewModels"); // multiple fields changing
|
||||||
// also clear the timeout if it is still running
|
// also clear the timeout if it is still running
|
||||||
this.disposeTracked(this._abortHomeserverQueryTimeout);
|
this.disposeTracked(this._abortHomeserverQueryTimeout);
|
||||||
const timeout = this.clock.createTimeout(1000);
|
const timeout = this.clock.createTimeout(1000);
|
||||||
|
|
Reference in a new issue