From 8af35cd30ca69abb2cf94dea2db19839c73323ff Mon Sep 17 00:00:00 2001 From: Norwin Roosen Date: Sun, 17 Feb 2019 13:41:06 +0100 Subject: [PATCH] remove option to select non-sensebox SSIDs not of use outside of development, worsens UX --- src/pages/ota-wizard/ota-wizard.html | 5 ----- src/pages/ota-wizard/ota-wizard.ts | 19 +++++++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/pages/ota-wizard/ota-wizard.html b/src/pages/ota-wizard/ota-wizard.html index 6e6107b..8f01638 100644 --- a/src/pages/ota-wizard/ota-wizard.html +++ b/src/pages/ota-wizard/ota-wizard.html @@ -108,11 +108,6 @@ - - Show only senseBox WiFis - - -

OTAWIZ.WIFI.AUTO.ERROR

diff --git a/src/pages/ota-wizard/ota-wizard.ts b/src/pages/ota-wizard/ota-wizard.ts index 6f1e361..7fc468e 100644 --- a/src/pages/ota-wizard/ota-wizard.ts +++ b/src/pages/ota-wizard/ota-wizard.ts @@ -27,7 +27,6 @@ export class OtaWizardPage implements OnInit, OnDestroy { offlineSub: Subscription sketch = '' - filterSsids = true availableSenseboxes: string[] = [] // list of SSIDs compiledSketch: ArrayBuffer = undefined errorMsg = '' @@ -46,12 +45,17 @@ export class OtaWizardPage implements OnInit, OnDestroy { navParams : NavParams, private compilerprovider:CompilerProvider ) { - this.sketch = navParams.get('sketch') - // for OTA to work, the new sketch has to include the OTA logic as well. // to ensure that, we're prepending it here to the sketch. // this also works regardless wether the sketch already contains this line. - this.sketch = '#include \n' + this.sketch + this.sketch = '#include \n' + + // get sketch from router param, or set minimal default code for successful compilation + let sketch = navParams.get('sketch') + if (!sketch) + sketch = 'void setup() {}\nvoid loop() {}\n' + + this.sketch += sketch } ngOnInit() { @@ -80,11 +84,6 @@ export class OtaWizardPage implements OnInit, OnDestroy { this.handleWifiSelection() } - onFilterToggle (newVal) { - this.filterSsids = newVal - this.handleWifiSelection() - } - onClose () { this.navCtrl.pop() } @@ -155,7 +154,7 @@ export class OtaWizardPage implements OnInit, OnDestroy { } else { this.state.wifiSelection = 'scanning' try { - this.availableSenseboxes = await this.otaWifi.findSenseboxes(this.filterSsids) + this.availableSenseboxes = await this.otaWifi.findSenseboxes(true) this.state.wifiSelection = 'select' } catch (err) { this.state.wifiSelection = 'error'