FIX: Return an empty identity if loading fails

FIX: Return an empty identity if loading fails

All operations assume an empty identity will be returned instead of an error being raised.

Follow up to 54d1f79a9eefa7e3a4e4a5b4b1303abe03ab72ed.

diff --git a/assets/javascripts/lib/database.js b/assets/javascripts/lib/database.js
index 9a95302..5b16a06 100644
--- a/assets/javascripts/lib/database.js
+++ b/assets/javascripts/lib/database.js
@@ -114,7 +114,7 @@ function loadIdentityFromLocalStorage() {
   const exported = window.localStorage.getItem(DB_NAME);
   return exported && exported !== "true"
     ? importIdentity(exported)
-    : Promise.reject();
+    : Promise.resolve(null);
 }
 
 /**
@@ -148,7 +148,7 @@ export function loadDbIdentity() {
           const identity = identities[identities.length - 1];
           resolve(identity);
         } else {
-          reject();
+          resolve(null);
         }
       };
       // eslint-disable-next-line no-unused-vars

GitHub sha: b273b0caeff467a9793e9c79a5202a9ac995d25d

This commit appears in #112 which was approved by pmusaraj. It was merged by udan11.