From 3a3df6222b3bfcd36b21ea917733e6f5b189c94d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 10 Apr 2024 19:12:22 -0300 Subject: sort: sortContributionsChronologically: fix non-mutating --- src/util/sort.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- cgit 1.3.0-6-gf8a5