Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: clone array before adding header

thecodrr332e08c37265
diff --git a/packages/core/utils/grouping.js b/packages/core/utils/grouping.js
index 192260713..0663d0b4c 100644
--- a/packages/core/utils/grouping.js
+++ b/packages/core/utils/grouping.js
@@ -51,8 +51,7 @@ export function groupArray(
fastsort(array).by(getSortSelectors(options));
if (options.groupBy === "none") {
- array.splice(0, 0, { title: "All", type: "header" });
- return array;
+ return [{ title: "All", type: "header" }, ...array];
}
const keySelector = KEY_SELECTORS[options.groupBy || "default"];