fixed wifi issue

MOHEMM-Q3-DEV-LATEST
umasoodch 4 years ago
parent 7f0b90bf6f
commit d2045776ba

@ -70,9 +70,16 @@ export class HMGUtils {
const location = _res.split(',')
console.log(location);
if (location.length == 3) {
let mock = false;
const lat = Number(_res.split(',')[0]);
const long = Number(_res.split(',')[1]);
const mock = Boolean(_res.split(',')[2]);
const mockValue = _res.split(',')[2];
if (mockValue == 'true') {
mock = true;
} else {
mock = false;
}
callBack({"latitude":lat, "longitude":long, "isfake":mock})
} else {
this.common.presentAlert(this.ts.trPK('general', 'invalid-huawei-location'));

@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0;
public static timeOut = 120 * 1000;
public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/';
// public static host = 'https://uat.hmgwebservices.com/';
public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient,
public cs: CommonService,

@ -26,6 +26,14 @@ export class WifiModalComponent implements OnInit {
public enableLocationWIFI: boolean;
public lat: number;
public longt: number;
public failedObjectWIFI = {
modeOfAttendance: 0,
messageStatus: 0,
transactionID: 0,
userID: '',
pointID: 0,
branchDescription: 0
}
constructor(
public common: CommonService,
@ -153,25 +161,39 @@ export class WifiModalComponent implements OnInit {
this.attendance_service
.attendanceSwipeScanner(request, () => {
console.debug("Error inside in swipe attendance");
if (enableFirestore) {
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
}
this.closeModal();
this.disconnectWifi();
})
.subscribe((result: Response) => {
}).subscribe((result: Response) => {
if (enableFirestore) {
this.attendScanService.processFirebaseDocument(isPlatformValue, result);
}
this.disconnectWifi();
// this.disconnectWifi();
if (this.common.validResponse(result)) {
this.ngZone.run(() => {
this.gifStatus = true;
});
setTimeout(() => {
this.closeModal();
// this.common.openAttenTrackingpage();
}, 4000);
}else{
console.debug(result);
if (result.MessageStatus && result.MessageStatus === 1) {
this.ngZone.run(() => {
this.gifStatus = true;
});
setTimeout(() => {
this.closeModal();
}, 4000);
this.disconnectWifi();
} else {
if (enableFirestore) {
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
}
this.disconnectWifi();
}
} else {
if (enableFirestore) {
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
}
this.disconnectWifi();
this.closeModal();
}
});

Loading…
Cancel
Save