diff --git a/src/domain/ViewModel.ts b/src/domain/ViewModel.ts index 7cf21861..00ae847b 100644 --- a/src/domain/ViewModel.ts +++ b/src/domain/ViewModel.ts @@ -58,7 +58,7 @@ export class ViewModel extends EventEmitter<{change return this._options[name]; } - observeNavigation(type: string, onChange: (value: string | true | undefined, type: string) => void) { + observeNavigation(type: string, onChange: (value: string | true | undefined, type: string) => void): void { const segmentObservable = this.navigation.observe(type); const unsubscribe = segmentObservable.subscribe((value: string | true | undefined) => { onChange(value, type); @@ -103,7 +103,7 @@ export class ViewModel extends EventEmitter<{change // // translated string should probably always be bindings, unless we're fine with a refresh when changing the language? // we probably are, if we're using routing with a url, we could just refresh. - i18n(parts: TemplateStringsArray, ...expr: any[]) { + i18n(parts: TemplateStringsArray, ...expr: any[]): string { // just concat for now let result = ""; for (let i = 0; i < parts.length; ++i) { diff --git a/src/domain/login/LoginViewModel.ts b/src/domain/login/LoginViewModel.ts index 2a80465a..67deede8 100644 --- a/src/domain/login/LoginViewModel.ts +++ b/src/domain/login/LoginViewModel.ts @@ -55,7 +55,7 @@ export class LoginViewModel extends ViewModel { this._loginToken = loginToken; this._client = new Client(this.platform); this._homeserver = defaultHomeserver; - void this._initViewModels(); + this._initViewModels(); } get passwordLoginViewModel(): PasswordLoginViewModel { @@ -98,11 +98,11 @@ export class LoginViewModel extends ViewModel { return !!this._abortQueryOperation; } - goBack() { + goBack(): void { this.navigation.push("session"); } - async _initViewModels() { + _initViewModels(): void { if (this._loginToken) { this._hideHomeserver = true; this._completeSSOLoginViewModel = this.track(new CompleteSSOLoginViewModel( @@ -115,11 +115,11 @@ export class LoginViewModel extends ViewModel { this.emitChange("completeSSOLoginViewModel"); } else { - await this.queryHomeserver(); + void this.queryHomeserver(); } } - _showPasswordLogin() { + _showPasswordLogin(): void { this._passwordLoginViewModel = this.track(new PasswordLoginViewModel( this.childOptions({ loginOptions: this._loginOptions, @@ -128,19 +128,19 @@ export class LoginViewModel extends ViewModel { this.emitChange("passwordLoginViewModel"); } - _showSSOLogin() { + _showSSOLogin(): void { this._startSSOLoginViewModel = this.track( new StartSSOLoginViewModel(this.childOptions({loginOptions: this._loginOptions})) ); this.emitChange("startSSOLoginViewModel"); } - _showError(message: string) { + _showError(message: string): void { this._errorMessage = message; this.emitChange("errorMessage"); } - _setBusy(status: boolean) { + _setBusy(status: boolean): void { this._isBusy = status; this._passwordLoginViewModel?.setBusy(status); this._startSSOLoginViewModel?.setBusy(status); @@ -193,14 +193,14 @@ export class LoginViewModel extends ViewModel { ); } - _disposeViewModels() { + _disposeViewModels(): void { this._startSSOLoginViewModel = this.disposeTracked(this._startSSOLoginViewModel); this._passwordLoginViewModel = this.disposeTracked(this._passwordLoginViewModel); this._completeSSOLoginViewModel = this.disposeTracked(this._completeSSOLoginViewModel); this.emitChange("disposeViewModels"); } - async setHomeserver(newHomeserver: string): void { + async setHomeserver(newHomeserver: string): Promise { this._homeserver = newHomeserver; // clear everything set by queryHomeserver this._loginOptions = undefined; @@ -226,7 +226,7 @@ export class LoginViewModel extends ViewModel { void this.queryHomeserver(); } - async queryHomeserver(): void { + async queryHomeserver(): Promise { // don't repeat a query we've just done if (this._homeserver === this._queriedHomeserver || this._homeserver === "") { return;