1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

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

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 list full-list" *ngIf="folders.length; else noFoldersTemplate">
<div class="box-content"> <div class="box-content">
<button <button
type="button" type="button"
appStopClick appStopClick
(click)="folderSelected(f)" (click)="folderSelected(f)"
class="box-content-row padded" class="box-content-row padded"
*ngFor="let f of folders$ | async" *ngFor="let f of folders"
> >
{{ f.name }} {{ f.name }}
</button> </button>
</div> </div>
</div> </div>
<div class="no-items" *ngIf="!(folders$ | async)?.length"> </ng-container>
<ng-template #noFoldersTemplate>
<div class="no-items">
<p>{{ "noFolders" | i18n }}</p> <p>{{ "noFolders" | i18n }}</p>
</div> </div>
</ng-template>
</main> </main>