From 9bd0e5920d3f03b2951d32465eb88dab930fc696 Mon Sep 17 00:00:00 2001 From: trivernis Date: Thu, 4 Nov 2021 22:59:57 +0100 Subject: [PATCH] Change file tag display to be sorted alphabetically Signed-off-by: trivernis --- .../src/app/pages/home/search-tab/search-tab.component.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mediarepo-ui/src/app/pages/home/search-tab/search-tab.component.ts b/mediarepo-ui/src/app/pages/home/search-tab/search-tab.component.ts index f65c07e..bbac829 100644 --- a/mediarepo-ui/src/app/pages/home/search-tab/search-tab.component.ts +++ b/mediarepo-ui/src/app/pages/home/search-tab/search-tab.component.ts @@ -62,13 +62,12 @@ export class SearchTabComponent implements OnInit { async onFileSelect(file: File | undefined) { if (file) { await this.showFileDetails([file]); - } else { - this.tags = []; } } async showFileDetails(files: File[]) { - this.tags = await this.tagService.getTagsForFiles(files.map(f => f.hash)); + this.tags = await this.tagService.getTagsForFiles(files.map(f => f.hash)) + this.tags = this.tags.sort((a, b) => a.getNormalizedOutput().localeCompare(b.getNormalizedOutput())); } async addSearchTagFromList(event: MatSelectionListChange) {