fix: undefined notes in groupBy

This commit is contained in:
thecodrr
2019-12-12 11:52:22 +05:00
parent 368bd9324f
commit 30546998bd

View File

@@ -54,6 +54,7 @@ class Database {
* @param {string} by One from 'abc', 'month', 'year' or 'week'. Leave it empty for default grouping.
*/
groupNotes(by) {
let notes = this.getNotes();
switch (by) {
case "abc":
return groupBy(notes, note => note.title[0].toUpperCase());