From 7555e6f7250346d2babb2b515c32f70d63b562b3 Mon Sep 17 00:00:00 2001 From: Yegor Gunko <57867800+yegorgunko@users.noreply.github.com> Date: Wed, 12 May 2021 17:05:06 +0300 Subject: [PATCH] refactored sort filter (#652) since extensions are already sorted, just reverse them if DESC selected --- src/.vuepress/components/ExtensionList.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/.vuepress/components/ExtensionList.vue b/src/.vuepress/components/ExtensionList.vue index 4d2691b9..4470c153 100644 --- a/src/.vuepress/components/ExtensionList.vue +++ b/src/.vuepress/components/ExtensionList.vue @@ -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) {