From 341c1a35d610dc195b8f2dd7b95b91ef0942231f Mon Sep 17 00:00:00 2001 From: trivernis Date: Sat, 5 Feb 2022 19:21:02 +0100 Subject: [PATCH] Fix handling of the empty preset option Signed-off-by: trivernis --- .../file-search/sort-dialog/sort-dialog.component.html | 2 +- .../sidebar/file-search/sort-dialog/sort-dialog.component.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.html b/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.html index 9d0c74b..1a53b2f 100644 --- a/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.html +++ b/mediarepo-ui/src/app/components/shared/sidebar/file-search/sort-dialog/sort-dialog.component.html @@ -5,7 +5,7 @@ Preset - + p.id == presetId); - + const preset = this.availablePresets.find(p => p.id == presetId) ?? this.emptyPreset; + if (preset) { this.sortingPreset.setData(JSON.parse(JSON.stringify(preset.rawData))); this.previousId = preset.id;