Skip to content

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

refactor: shorten null check

thecodrr35e285086161
diff --git a/packages/core/api/database.js b/packages/core/api/database.js
index c10d1ba80..ea43173b0 100644
--- a/packages/core/api/database.js
+++ b/packages/core/api/database.js
@@ -15,8 +15,7 @@ class Database {
*/
async getNotes() {
//update our cache
- this.notes = await this.storage.read(KEYS.notes);
- if (!this.notes) this.notes = {};
+ this.notes = (await this.storage.read(KEYS.notes)) || {};
return Object.values(this.notes);
}