[AC-4313] - Add missing sorting in list component on init (#3377)

This commit is contained in:
DominikIwanek
2023-08-09 18:06:22 +02:00
committed by GitHub
parent b3577fd17b
commit b790d3e81d

View File

@@ -68,7 +68,7 @@ export class DocumentListDirective implements OnInit, OnDestroy {
if (this.sortingPreferenceKey) { if (this.sortingPreferenceKey) {
const current = this.documentList.sorting; const current = this.documentList.sorting;
const key = this.preferences.get(`${this.sortingPreferenceKey}.sorting.key`, current[0]); const key = this.preferences.get(`${this.sortingPreferenceKey}.sorting.sortingKey`, current[0]);
const direction = this.preferences.get(`${this.sortingPreferenceKey}.sorting.direction`, current[1]); const direction = this.preferences.get(`${this.sortingPreferenceKey}.sorting.direction`, current[1]);
this.documentList.sorting = [key, direction]; this.documentList.sorting = [key, direction];
@@ -101,6 +101,7 @@ export class DocumentListDirective implements OnInit, OnDestroy {
onSortingChanged(event: CustomEvent) { onSortingChanged(event: CustomEvent) {
if (this.sortingPreferenceKey) { if (this.sortingPreferenceKey) {
this.preferences.set(`${this.sortingPreferenceKey}.sorting.key`, event.detail.key); this.preferences.set(`${this.sortingPreferenceKey}.sorting.key`, event.detail.key);
this.preferences.set(`${this.sortingPreferenceKey}.sorting.sortingKey`, event.detail.sortingKey);
this.preferences.set(`${this.sortingPreferenceKey}.sorting.direction`, event.detail.direction); this.preferences.set(`${this.sortingPreferenceKey}.sorting.direction`, event.detail.direction);
} }
} }