Skip to content

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

fix: return created groups

thecodrr368bd9324fa3
diff --git a/packages/core/api/database.js b/packages/core/api/database.js
index 551c3f75d..14cbe2d9e 100644
--- a/packages/core/api/database.js
+++ b/packages/core/api/database.js
@@ -63,9 +63,11 @@ class Database {
note => months[new Date(note.dateCreated).getMonth()]
);
case "week":
- groupBy(notes, note => getWeekGroupFromTimestamp(note.dateCreated));
+ return groupBy(notes, note =>
+ getWeekGroupFromTimestamp(note.dateCreated)
+ );
case "year":
- groupBy(
+ return groupBy(
notes,
note => months[new Date(note.dateCreated).getFullYear()]
);
@@ -74,7 +76,7 @@ class Database {
recent: getLastWeekTimestamp(7),
lastWeek: getLastWeekTimestamp(7) - 604800000 //seven day timestamp value
};
- groupBy(notes, note =>
+ return groupBy(notes, note =>
note.dateCreated >= timestamps.recent
? "Recent"
: note.dateCreated >= timestamps.lastWeek