« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/sort.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/util/sort.js b/src/util/sort.js
index 8a096dc1..ea1e024a 100644
--- a/src/util/sort.js
+++ b/src/util/sort.js
@@ -429,5 +429,10 @@ export function sortContributionsChronologically(data, sortThings, {
 
   sortByDate(contribs, {latestFirst});
 
-  return contribs;
+  // We're not actually operating on the original data array at any point,
+  // so since this is meant to be a mutating function like any other, splice
+  // the sorted contribs into the original array.
+  data.splice(0, data.length, ...contribs);
+
+  return data;
 }