Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Dec 2, 2023
1 parent dd991f2 commit 172eb9b
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions assets/eco-scripts/wallet_localStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ function getIDFromExtraAccountStillEncrypted(baseEncrypted, encryptedToSearch) {

async function getExtraWalletAccountFromLocalStorage() {
var mySafeExtraAccountsWallet = getLocalStorage("mySafeEncryptedExtraAccounts");
console.log("hello")
console.log(mySafeExtraAccountsWallet)
if (mySafeExtraAccountsWallet) {
mySafeExtraAccountsWallet = JSON.parse(mySafeExtraAccountsWallet);
var myRecreatedExtraAccounts = [];
Expand All @@ -31,16 +29,13 @@ async function getExtraWalletAccountFromLocalStorage() {
var storedKey = accountData.key;
var label = accountData.label;
var print = accountData.print;
console.log(storedKey)

var myRestoredAccount = new Neon.wallet.Account(storedKey);
console.log(myRestoredAccount)

try {
if (!Neon.wallet.isAddress(storedKey) && !Neon.wallet.isPublicKey(storedKey)) {
console.log("trying to decrypt from local storage")
if (!Neon.wallet.isAddress(storedKey) && !Neon.wallet.isPublicKey(storedKey))
await myRestoredAccount.decrypt(MASTER_KEY_WALLET);
}

console.log(myRestoredAccount)
myRecreatedExtraAccounts.push({
account: myRestoredAccount,
label: label,
Expand All @@ -51,16 +46,11 @@ async function getExtraWalletAccountFromLocalStorage() {
swal2Simple("Decryption error", "Error when decrypting extra accounts!", 5500, "error");
}
}));

console.log("finally")
console.log(myRecreatedExtraAccounts)
return myRecreatedExtraAccounts;
}

return [];
}


function restoreWalletExtraAccountsLocalStorage() {
var mySafeExtraAccountsWallet = getLocalStorage("mySafeEncryptedExtraAccounts");
if (mySafeExtraAccountsWallet && MASTER_KEY_WALLET == "") {
Expand Down

0 comments on commit 172eb9b

Please sign in to comment.