Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

πŸ”€ Merge pull request #2243 from hypermagicmountain/hyper

Alicia Sykes5bf3f95fed39
diff --cc src/utils/SortItems.js
index 053c87ea,ff7f7288..cb23c02f
--- a/src/utils/SortItems.js
+++ b/src/utils/SortItems.js
@@@ -13,8 -13,15 +13,15 @@@ const byTitle = (items) => [...items].s
const byUsage = (items, key) => {
const counts = readUsage(key);
const get = (item) => counts[item.id] || 0;
- return [...items].reverse().sort((a, b) => (get(a) < get(b) ? 1 : -1));
+ return [...items].sort((a, b) => get(b) - get(a));
};
+ const byProvider = (items) => [...items].sort(
+ (a, b) => ((a.provider || '').toLowerCase() > (b.provider || '').toLowerCase() ? 1 : -1),
+ );
+
+ const byID = (items) => [...items].sort(
+ (a, b) => ((a.id || '').toLowerCase() > (b.id || '').toLowerCase() ? 1 : -1),
+ );
const shuffled = (items) => items
.map((value) => ({ value, sort: Math.random() }))