From 0379ee4e8979addfae23a69470da23921440dc62 Mon Sep 17 00:00:00 2001 From: umasoodch Date: Tue, 9 Mar 2021 11:31:02 +0300 Subject: [PATCH] removed wifi issue checks --- .../attendance-options.component.ts | 34 ++++++------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/Mohem/src/app/home/attendance-options/attendance-options.component.ts b/Mohem/src/app/home/attendance-options/attendance-options.component.ts index b61d00ac..446d31ea 100644 --- a/Mohem/src/app/home/attendance-options/attendance-options.component.ts +++ b/Mohem/src/app/home/attendance-options/attendance-options.component.ts @@ -208,19 +208,6 @@ export class AttendanceOptionsComponent implements OnInit { } } - async verifyWIFIConfiguration() { - try { - let ssid_ = await this.wifiWizard2.getConnectedSSID(); - if(ssid_ == this.ssid){ - this.common.presentAlert(this.ts.trPK("general", "forget-wifi-connection-text")); - } else { - this.startWIFIProcedure(); - } - } catch (err) { - this.common.presentAlert(this.ts.trPK("general", "forget-wifi-connection-text")); - } - } - // Wifi Attendance public async startWifi() { const isAndroid = this.platform.is("android"); @@ -231,8 +218,6 @@ export class AttendanceOptionsComponent implements OnInit { if(!isWifiEnabled){ this.showWifiNotEnabled(); return; - } else { - this.verifyWIFIConfiguration(); } } else if(isAndroid) { let locationPermission = await this.devicePermissionsService.requestLocationAutherization(); @@ -240,15 +225,16 @@ export class AttendanceOptionsComponent implements OnInit { return; } - if (!isWifiEnabled) { - this.showWifiNotEnabled(); - } else { - this.startWIFIProcedure(); - } + if(!isWifiEnabled){ + this.wifiWizard2.setWifiEnabled(true).then(()=>{ + this.startWifi(); + }).catch((err) => { + console.debug(err); + }); + return; } - } - - async startWIFIProcedure () { + + // opening wifi dailog if all above conditions are passed (isWifiEnabled == true) let modal = await this.modalController.create({ component: WifiModalComponent, showBackdrop: true, @@ -257,6 +243,8 @@ export class AttendanceOptionsComponent implements OnInit { modal.cssClass = "wifi-modal"; await modal.present(); } +} + showWifiNotEnabled(){