From 1f342b72f33afb4061871f1d19025abeb3f46d05 Mon Sep 17 00:00:00 2001 From: Sai Jatin K Date: Sat, 20 Jun 2020 14:21:51 +0530 Subject: [PATCH] bugfix Collections Sorting - # of sketches is incorrect #1441 --- client/modules/IDE/selectors/collections.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/modules/IDE/selectors/collections.js b/client/modules/IDE/selectors/collections.js index f212103a..dd052aab 100644 --- a/client/modules/IDE/selectors/collections.js +++ b/client/modules/IDE/selectors/collections.js @@ -37,6 +37,11 @@ const getSortedCollections = createSelector( return orderBy(collections, 'name', 'desc'); } return orderBy(collections, 'name', 'asc'); + } else if (field === 'numItems') { + if (direction === DIRECTION.DESC) { + return orderBy(collections, 'items.length', 'desc'); + } + return orderBy(collections, 'items.length', 'asc'); } const sortedCollections = [...collections].sort((a, b) => { const result =