« get me outta code hell

data: make sortByConditions return sorted array - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-04-27 16:57:09 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-27 16:57:09 -0300
commit7830c73e6047ab8ec1322c4a56ed6a450bfb11e6 (patch)
treedbb1308e4294490c4745d74b0282f53f60f0f60b
parent6128ba16c1b5c4c6095e0ddba0977817cce4bc6e (diff)
data: make sortByConditions return sorted array
This wasn't causing any bugs within the codebase but it should be
consistent with the rest of the sort functions anyway.
-rw-r--r--src/util/wiki-data.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js
index 2a8f12ca..89c621c5 100644
--- a/src/util/wiki-data.js
+++ b/src/util/wiki-data.js
@@ -260,7 +260,7 @@ export function sortByPositionInFlashAct(data) {
 // set of arbitrary given conditions is true first. If no conditions are met
 // for a given item, it's moved over to the end!
 export function sortByConditions(data, conditions) {
-  data.sort((a, b) => {
+  return data.sort((a, b) => {
     const ai = conditions.findIndex((f) => f(a));
     const bi = conditions.findIndex((f) => f(b));