Skip to content

Commit

Permalink
[AC-4313] - Add missing sorting in list component on init (#3377)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikiwanekhyland committed Aug 9, 2023
1 parent b3577fd commit b790d3e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class DocumentListDirective implements OnInit, OnDestroy {
if (this.sortingPreferenceKey) {
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]);

this.documentList.sorting = [key, direction];
Expand Down Expand Up @@ -101,6 +101,7 @@ export class DocumentListDirective implements OnInit, OnDestroy {
onSortingChanged(event: CustomEvent) {
if (this.sortingPreferenceKey) {
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);
}
}
Expand Down

0 comments on commit b790d3e

Please sign in to comment.