fix: Default category disappear everytime a new category is added

This commit is contained in:
Ahmad Ansori Palembani 2025-01-05 18:11:00 +07:00
parent 32019a2fd7
commit 4b4c375f44
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6

View file

@ -740,7 +740,15 @@ class LibraryPresenter(
values.sortedWith(Comparator(sortFn))
}.toSortedMap { category, category2 ->
category.order.compareTo(category2.order)
// Force default category to already be at the top. This also for some reason fixed a bug where Default
// category would disappear whenever a new category is added.
if (category.id == 0) {
-1
} else if (category2.id == 0) {
1
} else {
category.order.compareTo(category2.order)
}
}
}