fixed app update issue

MOE_DEV_NEW_TEMPORARY_DESIGN
umasoodch 4 years ago
parent 2f9e24c332
commit 52d16d77e8

@ -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) {

@ -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();
}
}
}

@ -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<CheckAppVersionResponse> {
const request = new Request();
this.setPublicFields(request);
return this.con.post(AuthenticationService.checkAppVersion, request, onError);
return this.con.post(AuthenticationService.checkAppVersion, request, onError, '', true);
}

@ -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) {

Loading…
Cancel
Save