refactored sort filter (#652)

since extensions are already sorted, just reverse them if DESC selected
This commit is contained in:
Yegor Gunko 2021-05-12 17:05:06 +03:00 committed by GitHub
parent b6f85fc9a7
commit 7555e6f725

View File

@ -123,9 +123,7 @@ export default {
);
if (filters.sort && filters.sort === "Descending") {
filteredGroup = filteredGroup.sort((a, b) => {
return a.name < b.name ? 1 : a.name > b.name ? -1 : 0;
});
filteredGroup = filteredGroup.reverse();
}
if (filteredGroup.length) {