refactored folders component template to use a single subscription (#7879)

This commit is contained in:
SmithThe4th 2024-02-08 16:44:35 -05:00 committed by GitHub
parent 83fabbc93e
commit 3ee27fc61f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 19 additions and 15 deletions

View File

@ -15,20 +15,24 @@
</div> </div>
</header> </header>
<main tabindex="-1"> <main tabindex="-1">
<div class="box list full-list" *ngIf="(folders$ | async)?.length"> <ng-container *ngIf="folders$ | async as folders">
<div class="box-content"> <div class="box list full-list" *ngIf="folders.length; else noFoldersTemplate">
<button <div class="box-content">
type="button" <button
appStopClick type="button"
(click)="folderSelected(f)" appStopClick
class="box-content-row padded" (click)="folderSelected(f)"
*ngFor="let f of folders$ | async" class="box-content-row padded"
> *ngFor="let f of folders"
{{ f.name }} >
</button> {{ f.name }}
</button>
</div>
</div> </div>
</div> </ng-container>
<div class="no-items" *ngIf="!(folders$ | async)?.length"> <ng-template #noFoldersTemplate>
<p>{{ "noFolders" | i18n }}</p> <div class="no-items">
</div> <p>{{ "noFolders" | i18n }}</p>
</div>
</ng-template>
</main> </main>