mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-19 04:59:33 +01:00
refactor: shorten null check
This commit is contained in:
@@ -15,8 +15,7 @@ class Database {
|
|||||||
*/
|
*/
|
||||||
async getNotes() {
|
async getNotes() {
|
||||||
//update our cache
|
//update our cache
|
||||||
this.notes = await this.storage.read(KEYS.notes);
|
this.notes = (await this.storage.read(KEYS.notes)) || {};
|
||||||
if (!this.notes) this.notes = {};
|
|
||||||
return Object.values(this.notes);
|
return Object.values(this.notes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user