refactor: shorten null check

This commit is contained in:
thecodrr
2019-11-29 18:35:17 +05:00
parent 3d1c80bc96
commit 35e2850861

View File

@@ -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);
}