diff --git a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts index 5024b59e..9e719df8 100644 --- a/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts +++ b/Mohem/src/app/authentication/confirm-login/confirm-login.component.ts @@ -19,6 +19,7 @@ import * as moment from 'moment'; import { CheckAppVersionResponse } from 'src/app/hmg-common/services/authentication/models/check-app-version.response'; import { NFC } from "@ionic-native/nfc/ngx"; import { DigitalIdComponent } from '../digital-id/digital-id.component'; +import { AppUpdateComponent } from '../app-update/app-update.component'; @Component({ selector: 'app-confirm-login', @@ -455,16 +456,25 @@ export class ConfirmLoginComponent implements OnInit { this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => { // tslint:disable-next-line: triple-equals if (result.MessageStatus == 2 && result.ErrorType == 4) { - this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { - this.handleAppUpdate(result); - }); - // tslint:disable-next-line: triple-equals + this.appUpdate(result.ErrorEndUserMessage, result); } else if (result.MessageStatus == 1) { this.checkUserAuthentication(); } }); } + async appUpdate(msg, result) { + const modal = await this.modalController.create({ + component: AppUpdateComponent, + cssClass: 'app-update-modal-css', + componentProps: {'msg':msg} + }); + modal.onDidDismiss().then((data) => { + this.handleAppUpdate(result); + }); + return await modal.present(); + } + checkAccess(el: any, isDigitalID = false, buttonType?) { const data = this.sharedData.getSharedData(AuthenticationService.LOGIN_DATA, false); if (isDigitalID) { diff --git a/Mohem/src/app/authentication/login/login.component.ts b/Mohem/src/app/authentication/login/login.component.ts index 52f8bb9e..95d86244 100644 --- a/Mohem/src/app/authentication/login/login.component.ts +++ b/Mohem/src/app/authentication/login/login.component.ts @@ -195,13 +195,8 @@ export class LoginComponent implements OnInit, OnDestroy { public checkAppUpdated() { this.authService.checkApplicationVersion(() => { }).subscribe((result: CheckAppVersionResponse) => { - // tslint:disable-next-line: triple-equals if (result.MessageStatus == 2 && result.ErrorType == 4) { this.appUpdate(result.ErrorEndUserMessage, result); - // this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { - // this.handleAppUpdate(result); - // }); - // tslint:disable-next-line: triple-equals } else if (result.MessageStatus == 1) { this.checkUserAuthentication(); } @@ -413,6 +408,6 @@ export class LoginComponent implements OnInit, OnDestroy { this.handleAppUpdate(result); }); return await modal.present(); - } + } } diff --git a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts index 5642d5b3..250ab68f 100644 --- a/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts +++ b/Mohem/src/app/hmg-common/services/authentication/authentication.service.ts @@ -142,7 +142,7 @@ export class AuthenticationService { } else { mobileType = 'android'; } - request.VersionID = 3; + request.VersionID = 2.9; request.Channel = 31; request.LanguageID = TranslatorService.getCurrentLanguageCode(); request.MobileType = mobileType; @@ -212,7 +212,7 @@ export class AuthenticationService { public checkApplicationVersion(onError: any): Observable { const request = new Request(); this.setPublicFields(request); - return this.con.post(AuthenticationService.checkAppVersion, request, onError); + return this.con.post(AuthenticationService.checkAppVersion, request, onError, '', true); } diff --git a/Mohem/src/app/hmg-common/services/connector/connector.service.ts b/Mohem/src/app/hmg-common/services/connector/connector.service.ts index ddd23f6d..c869c5ef 100644 --- a/Mohem/src/app/hmg-common/services/connector/connector.service.ts +++ b/Mohem/src/app/hmg-common/services/connector/connector.service.ts @@ -227,15 +227,15 @@ export class ConnectorService { if (!this.cs.validResponse(result)) { if (result.IsAuthenticated === false) { this.cs.stopLoading(); - this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { - this.cs.sharedService.clearAll(); - // this.cs.openLogin(); - this.getLastLoginInfo(); - }); + if (!fromSMS) { + this.cs.presentAcceptDialog(result.ErrorEndUserMessage, () => { + this.cs.sharedService.clearAll(); + this.getLastLoginInfo(); + }); + } return false; } else if (result.ErrorType === 2 || result.ErrorType === 4) { - // console.log("error expired"); - this.cs.stopLoading(); + this.cs.stopLoading(); } else { this.cs.stopLoading(); if (!fromSMS) {