last minute changes

This commit is contained in:
Drew Ansbacher
2022-02-27 17:58:11 -07:00
committed by Aiden McClelland
parent a6e00449f6
commit df16943502
8 changed files with 108 additions and 61 deletions

View File

@@ -108,8 +108,11 @@ export class AppShowStatusComponent {
async stop(): Promise<void> {
const { id, title, version } = this.pkg.manifest
const hasDependents = !!Object.keys(
this.pkg.installed['current-dependents'],
).filter(depId => depId !== this.pkg.manifest.id).length
if (isEmptyObject(this.pkg.installed['current-dependents'])) {
if (!hasDependents) {
const loader = await this.loadingCtrl.create({
message: `Stopping...`,
spinner: 'lines',

View File

@@ -90,7 +90,7 @@ export class MarketplacesPage {
async presentAction(id: string) {
// no need to view actions if is selected marketplace
if (id === this.patch.getData().ui.marketplace['selected-id']) return
if (id === this.patch.getData().ui.marketplace?.['selected-id']) return
const buttons: ActionSheetButton[] = [
{

View File

@@ -79,7 +79,9 @@
<!-- not loading -->
<ng-container *ngIf="!loading && wifi.country">
<ion-item-divider>Saved Networks</ion-item-divider>
<ion-item-divider *ngIf="!(wifi.ssids | empty)"
>Saved Networks</ion-item-divider
>
<ion-item
button
detail="false"
@@ -126,38 +128,40 @@
</ion-item>
<ion-item-divider>Available Networks</ion-item-divider>
<ion-item
button
detail="false"
*ngFor="let avWifi of wifi['available-wifi']"
(click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)"
>
<ion-label>{{ avWifi.ssid }}</ion-label>
<img
*ngIf="avWifi.strength < 5"
slot="end"
src="assets/img/icons/wifi-1.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 5 && avWifi.strength < 50"
slot="end"
src="assets/img/icons/wifi-1.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 50 && avWifi.strength < 90"
slot="end"
src="assets/img/icons/wifi-2.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 90"
slot="end"
src="assets/img/icons/wifi-3.png"
style="max-width: 32px"
/>
</ion-item>
<ng-container *ngFor="let avWifi of wifi['available-wifi']">
<ion-item
button
detail="false"
(click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)"
*ngIf="avWifi.ssid"
>
<ion-label>{{ avWifi.ssid }}</ion-label>
<img
*ngIf="avWifi.strength < 5"
slot="end"
src="assets/img/icons/wifi-1.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 5 && avWifi.strength < 50"
slot="end"
src="assets/img/icons/wifi-1.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 50 && avWifi.strength < 90"
slot="end"
src="assets/img/icons/wifi-2.png"
style="max-width: 32px"
/>
<img
*ngIf="avWifi.strength >= 90"
slot="end"
src="assets/img/icons/wifi-3.png"
style="max-width: 32px"
/>
</ion-item>
</ng-container>
<ion-item button detail="false" (click)="presentModalAdd()">
<ion-icon slot="start" name="add" size="large"></ion-icon>
<ion-label>Join other network</ion-label>

View File

@@ -40,8 +40,16 @@ export class WifiPage {
) {}
async ngOnInit() {
await this.getWifi()
}
async getWifi(timeout?: number): Promise<void> {
this.loading = true
try {
await this.getWifi()
this.wifi = await this.api.getWifi({}, timeout)
if (!this.wifi.country) {
await this.presentAlertCountry()
}
} catch (e) {
this.errToast.present(e)
} finally {
@@ -49,13 +57,6 @@ export class WifiPage {
}
}
async getWifi(timeout?: number): Promise<void> {
this.wifi = await this.api.getWifi({}, timeout)
if (!this.wifi.country) {
await this.presentAlertCountry()
}
}
async presentAlertCountry(): Promise<void> {
if (!this.config.isLan) {
const alert = await this.alertCtrl.create({