Skip to content

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

feat: add pinned items group at the top

thecodrr090be2642fd1
diff --git a/packages/core/utils/index.js b/packages/core/utils/index.js
index fdc922dce..4002d2407 100644
--- a/packages/core/utils/index.js
+++ b/packages/core/utils/index.js
@@ -1,7 +1,7 @@
export function groupBy(arr, key) {
- let groups = {};
+ let groups = { Pinned: [] };
arr.forEach((item) => {
- let groupTitle = key(item);
+ let groupTitle = item.pinned ? "Pinned" : key(item);
let group = groups[groupTitle]
? groups[groupTitle]
: (groups[groupTitle] = []);