mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: never let totalNotes go below 0
This commit is contained in:
@@ -339,8 +339,9 @@ class Database {
|
||||
//delete notebook from note
|
||||
this.notes[noteId].notebook = {};
|
||||
//decrement totalNotes count
|
||||
notebook.topics[topicIndex].totalNotes--;
|
||||
notebook.totalNotes--;
|
||||
if (notebook.topics[topicIndex].totalNotes > 0)
|
||||
notebook.topics[topicIndex].totalNotes--;
|
||||
if (notebook.totalNotes > 0) notebook.totalNotes--;
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user