« get me outta code hell

sort: sortContributionsChronologically: getThing - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/common-util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-04-08 18:34:21 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-04-10 16:02:42 -0300
commit32db75dcff4ea1aca600420644654ef1071ccfd2 (patch)
tree65f750bfa7b0b102b30dfccc22f59a059aaa0e2d /src/common-util
parentbb7bebc12df16c69598215de4c713ea47eb12eda (diff)
sort: sortContributionsChronologically: getThing
Diffstat (limited to 'src/common-util')
-rw-r--r--src/common-util/sort.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common-util/sort.js b/src/common-util/sort.js
index fd382033..3cfe8f70 100644
--- a/src/common-util/sort.js
+++ b/src/common-util/sort.js
@@ -413,6 +413,7 @@ export function sortFlashesChronologically(data, {
 
 export function sortContributionsChronologically(data, sortThings, {
   latestFirst = false,
+  getThing = contrib => contrib.thing,
 } = {}) {
   // Contributions only have one date property (which is provided when
   // the contribution is created). They're sorted by this most primarily,
@@ -421,7 +422,7 @@ export function sortContributionsChronologically(data, sortThings, {
   const entries =
     data.map(contrib => ({
       entry: contrib,
-      thing: contrib.thing,
+      thing: getThing(contrib),
     }));
 
   sortEntryThingPairs(