From 35e285086161007930c4666b245cccf3b32b6472 Mon Sep 17 00:00:00 2001 From: thecodrr Date: Fri, 29 Nov 2019 18:35:17 +0500 Subject: [PATCH] refactor: shorten null check --- packages/core/api/database.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); }