Fixed: (UI) Fix search sorting by empty categories

pull/1587/head
Bogdan 1 year ago
parent b7fcdb5356
commit f638cf34d1

@ -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];

Loading…
Cancel
Save