fix sorting in category-sort

This commit is contained in:
Maximilian Krambach 2019-05-02 11:15:50 +02:00
parent d7c6583b7e
commit 52c6e05aba

View File

@ -128,7 +128,7 @@ export class CategorySortComponent extends BaseViewComponent implements OnInit,
* @param motions An array containing the new motions. * @param motions An array containing the new motions.
*/ */
private initializeList(motions: ViewMotion[]): void { private initializeList(motions: ViewMotion[]): void {
motions.sort((a, b) => (a.category_weight < b.category_weight ? -1 : 1)); motions.sort((a, b) => a.category_weight - b.category_weight);
this.motionsSubject.next(motions); this.motionsSubject.next(motions);
this.motionsCopy = motions; this.motionsCopy = motions;
} }