Sort motions in categories by inner weight (again)
Fixes sorting categories by inner weight
This commit is contained in:
parent
b7566fcc69
commit
5b7bbfd0bb
@ -98,10 +98,10 @@ export class MotionSortListService extends BaseSortListService<ViewMotion> {
|
|||||||
* @returns {number} The result of comparing.
|
* @returns {number} The result of comparing.
|
||||||
*/
|
*/
|
||||||
private categorySortFn(itemA: ViewMotion, itemB: ViewMotion, ascending: boolean): number {
|
private categorySortFn(itemA: ViewMotion, itemB: ViewMotion, ascending: boolean): number {
|
||||||
if (itemA.category.weight < itemB.category.weight === ascending) {
|
if (itemA.category_id === itemB.category_id) {
|
||||||
return -1;
|
return itemA.category_weight < itemB.category_weight === ascending ? -1 : 1;
|
||||||
} else {
|
} else {
|
||||||
return 1;
|
return itemA.category.weight < itemB.category.weight === ascending ? -1 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user