about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/lists
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-09-21 23:06:58 -0500
committerFire Demon <firedemon@creature.cafe>2020-09-21 23:06:58 -0500
commit0f60fd09f614b4f2f09f1cb1c8b2722767105261 (patch)
treeb70d2349132c674c6969d3b5742eb15d4b168769 /app/javascript/flavours/glitch/features/lists
parent14ab244bacab1649f344b08d6898eccccea45311 (diff)
Sort boosts list to top of lists
Diffstat (limited to 'app/javascript/flavours/glitch/features/lists')
-rw-r--r--app/javascript/flavours/glitch/features/lists/index.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/lists/index.js b/app/javascript/flavours/glitch/features/lists/index.js
index e384f301b..3863b8e25 100644
--- a/app/javascript/flavours/glitch/features/lists/index.js
+++ b/app/javascript/flavours/glitch/features/lists/index.js
@@ -24,7 +24,10 @@ const getOrderedLists = createSelector([state => state.get('lists')], lists => {
     return lists;
   }
 
-  return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')));
+  return lists.toList().filter(item => !!item).sort((a, b) => {
+    const r = (b.get('reblogs') ? 1 : 0) - (a.get('reblogs') ? 1 : 0);
+    return r === 0 ? a.get('title').localeCompare(b.get('title')) : r;
+  });
 });
 
 const mapStateToProps = state => ({