Skip to content

Commit

Permalink
PharmaLedger-IMI/epi-workspace#1062 dispatch "error" events when db c…
Browse files Browse the repository at this point in the history
…annot to be initialised
  • Loading branch information
skutner committed Dec 7, 2022
1 parent bfc8fe4 commit 8c58696
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/scripts/controllers/HomeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class HomeController extends DwController {
console.log("Error on getting wallet with recovery code", e)
this.ui.showToast("Couldn't recover wallet for inserted recovery code.");
target.loading = false;
return;
}
})
}
Expand All @@ -193,6 +192,9 @@ class HomeController extends DwController {
try {
keySSI.parse(recoveryCode); // parse and check if the recoveryCode has the right format for a sharedEnclaveKeySSI
const sharedEnclave = enclaveAPI.initialiseWalletDBEnclave(recoveryCode);
sharedEnclave.on("error", err => {
return reject(err);
});
sharedEnclave.on("initialised", async () => {
await $$.promisify(scAPI.setSharedEnclave)(sharedEnclave);
return resolve();
Expand Down

0 comments on commit 8c58696

Please # to comment.