add ex handling on wallet init

This commit is contained in:
Sebastian 2021-08-09 10:42:56 -03:00
parent 2ec3f4a5d5
commit abbf899b97
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -261,7 +261,13 @@ async function reinitWallet(): Promise<void> {
http, http,
new BrowserCryptoWorkerFactory(), new BrowserCryptoWorkerFactory(),
); );
await wallet.handleCoreApiRequest("initWallet", "native-init", {}); try {
await wallet.handleCoreApiRequest("initWallet", "native-init", {});
} catch (e) {
console.error("could not initialize wallet", e);
walletInit.reject(e);
return;
}
wallet.addNotificationListener((x) => { wallet.addNotificationListener((x) => {
for (const x of notificationPorts) { for (const x of notificationPorts) {
try { try {