|
|
|
|
@ -10,6 +10,7 @@ import { TranslatorService } from 'src/app/hmg-common/services/translator/transl
|
|
|
|
|
import { Platform } from "@ionic/angular";
|
|
|
|
|
import { WifiWizard2 } from "@ionic-native/wifi-wizard-2/ngx";
|
|
|
|
|
import { OpenNativeSettings } from '@ionic-native/open-native-settings/ngx';
|
|
|
|
|
import { AttendScanService } from "../../hmg-common/services/attend-services/attend-scan.service";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-wifi-modal',
|
|
|
|
|
@ -36,6 +37,7 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
private wifiWizard2: WifiWizard2,
|
|
|
|
|
private openNativeSettings: OpenNativeSettings,
|
|
|
|
|
private platform: Platform,
|
|
|
|
|
public attendScanService: AttendScanService
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
@ -134,7 +136,9 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async swipeAttendanceWifi(code:any) {
|
|
|
|
|
async swipeAttendanceWifi(code:any) {
|
|
|
|
|
const firestoreDocument = this.common.sharedService.getSharedData('firebase-document', false);
|
|
|
|
|
const isPlatformValue = this.platform.is('ios') ? 'QR-IOS' : 'QR-ANDROID';
|
|
|
|
|
const request: attendanceSwipeScannerRequest = new attendanceSwipeScannerRequest();
|
|
|
|
|
request.PointType = 3;
|
|
|
|
|
request.Latitude = this.lat;
|
|
|
|
|
@ -153,6 +157,7 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
})
|
|
|
|
|
.subscribe((result: Response) => {
|
|
|
|
|
this.attendScanService.processFirebaseDocument(isPlatformValue, result, firestoreDocument.isDocumentAvailable);
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.ngZone.run(() => {
|
|
|
|
|
|