Fixed: (UI) Fix search sorting by empty categories

This commit is contained in:
Bogdan
2023-04-07 18:06:43 +03:00
parent b7fcdb5356
commit f638cf34d1

View File

@@ -144,7 +144,7 @@ export const defaultState = {
},
category: function(item) {
if (item.categories.length > 0) {
if (item.categories !== undefined && item.categories.length > 0) {
const sortedCats = item.categories.filter((cat) => cat.name !== undefined).sort((c) => c.id);
const firstCat = sortedCats[0];