|
2 | 2 | <div class="position-sticky w-100 top-0 d-flex flex-row z-3"> |
3 | 3 | <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="modal.dismiss('Close click')"></button> |
4 | 4 | </div> |
| 5 | + @let installed = installedInfo$ | async; |
5 | 6 | <div class="d-flex flex-wrap flex-sm-row"> |
6 | 7 | <img class="app-details-icon" [ngSrc]="item.detailIconUri ?? item.iconUri" width="160" height="160" alt="App icon"/> |
7 | 8 | <div class="flex-fill my-2 ms-3 d-flex flex-column"> |
8 | 9 | <h1>{{ item.title }}</h1> |
9 | 10 | <label class="mt-1"> |
10 | 11 | Version {{ item.manifest?.version }} |
11 | | - <ng-container *ngIf="(installedInfo$ | async) as installed"> |
| 12 | + @if (installed) { |
12 | 13 | (Installed: {{ installed?.version }}) |
13 | | - </ng-container> |
| 14 | + } |
14 | 15 | </label> |
15 | 16 | <label class="mt-1 fw-bold" *ngIf="item.manifest?.rootRequired" [ngSwitch]="item.manifest?.rootRequired"> |
16 | 17 | <ng-container *ngSwitchCase="true">Root required</ng-container> |
17 | 18 | <ng-container *ngSwitchCase="'optional'">Root is optional</ng-container> |
18 | 19 | </label> |
19 | 20 | </div> |
20 | | - @let installed = installedInfo$ | async; |
21 | 21 | <div class="d-flex flex-column justify-content-center ms-auto"> |
22 | 22 | <ng-container> |
23 | 23 | <div class="btn-group text-nowrap ms-2" role="group" aria-label="Actions"> |
24 | | - <ng-container [ngSwitch]="installed && manifest.hasUpdate(installed.version)"> |
25 | | - <button class="btn btn-primary ms-2 text-nowrap" (click)="parent?.launchApp(item.id)" |
26 | | - *ngSwitchCase="false"> |
27 | | - <i class="bi bi-play-fill me-2"></i>Launch |
28 | | - </button> |
29 | | - <button class="btn btn-primary ms-2 text-nowrap" (click)="installPackage(item)" |
30 | | - *ngSwitchCase="true"> |
31 | | - <i class="bi bi-download me-2"></i>Update |
32 | | - </button> |
33 | | - <button class="btn btn-primary ms-2 text-nowrap" (click)="installPackage(item)" *ngSwitchDefault> |
34 | | - <i class="bi bi-download me-2"></i>Install |
35 | | - </button> |
36 | | - </ng-container> |
| 24 | + @switch (installed && manifest.hasUpdate(installed.version)) { |
| 25 | + @case (false) { |
| 26 | + <button class="btn btn-primary" (click)="parent?.launchApp(item.id)" aria-label="Launch"> |
| 27 | + <i class="bi bi-play-fill me-2"></i>Launch |
| 28 | + </button> |
| 29 | + } |
| 30 | + @case (true) { |
| 31 | + <button class="btn btn-primary" (click)="installPackage(item)" aria-label="Update"> |
| 32 | + <i class="bi bi-download me-2"></i>Update |
| 33 | + </button> |
| 34 | + } |
| 35 | + @default { |
| 36 | + <button class="btn btn-primary" (click)="installPackage(item)" aria-label="Install"> |
| 37 | + <i class="bi bi-download me-2"></i>Install |
| 38 | + </button> |
| 39 | + } |
| 40 | + } |
37 | 41 | <div class="btn-group" ngbDropdown container="body" display="dynamic" role="group" |
38 | 42 | aria-label="More options"> |
39 | 43 | <button class="btn btn-primary" ngbDropdownToggle> |
|
0 commit comments