MOBILE-3320 airnotifier: Improve devices screen

main
Pau Ferrer Ocaña 2021-06-21 12:57:25 +02:00
parent ed6044ad28
commit d60eddf410
2 changed files with 12 additions and 4 deletions

View File

@ -12,10 +12,13 @@
</ion-refresher> </ion-refresher>
<core-loading [hideUntil]="devicesLoaded"> <core-loading [hideUntil]="devicesLoaded">
<ion-list> <ion-list>
<ion-item class="ion-text-wrap" *ngFor="let device of devices"> <ion-item class="ion-text-wrap" *ngFor="let device of devices" [class.item-current]="device.current">
<ion-label [class.core-bold]="device.current"> <ion-label [class.core-bold]="device.current">
{{ device.name }} {{ device.model }} {{ device.platform }} {{ device.version }} <p class="item-heading">
{{ device.name }} {{ device.model }}
<span *ngIf="device.current">({{ 'core.currentdevice' | translate }})</span> <span *ngIf="device.current">({{ 'core.currentdevice' | translate }})</span>
</p>
<p>{{ device.platform }} {{ device.version }}</p>
</ion-label> </ion-label>
<core-button-with-spinner [loading]="device.updating" slot="end"> <core-button-with-spinner [loading]="device.updating" slot="end">
<ion-toggle <ion-toggle

View File

@ -74,7 +74,12 @@ export class AddonMessageOutputAirnotifierDevicesPage implements OnInit, OnDestr
device.current = !!(pushId && pushId == device.pushid); device.current = !!(pushId && pushId == device.pushid);
}); });
return formattedDevices; return formattedDevices.sort((a, b) => {
const compareA = a.name.toLowerCase();
const compareB = b.name.toLowerCase();
return compareA.localeCompare(compareB);
});
} }
/** /**