Skip to content

Commit

Permalink
web: simplify getting notebook total notes count
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Sep 8, 2022
1 parent f2d30ad commit 67000f9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions apps/web/src/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ export async function restoreBackupFile(backup) {
}

export function getTotalNotes(notebook) {
return notebook.topics.reduce((sum, topic) => {
if (!topic || !topic.notes) return sum;
return sum + topic.notes.length;
}, 0);
return db.notebooks.notebook(notebook)?.totalNotes;
}

export async function verifyAccount() {
Expand Down

0 comments on commit 67000f9

Please sign in to comment.