Skip to content

Commit

Permalink
Merge pull request #24 from nemmtor/fix/get-accounts
Browse files Browse the repository at this point in the history
fix: get accounts
  • Loading branch information
lennardevertz authored Jan 19, 2024
2 parents 8a98921 + ea43690 commit 01f6974
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idriss-crypto/send-to-anyone-core",
"version": "0.4.8",
"version": "0.4.9",
"scripts": {
"build": "webpack",
"buildLocal": "webpack --watch --mode=none",
Expand Down
7 changes: 3 additions & 4 deletions src/sendToAnyoneLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,9 @@ export const SendToAnyoneLogic = {
}

// exchanged for redundant multiple get accounts calls
const accounts = await this.web3.eth.getAccounts();
let selectedAccount = accounts[0];
const selectedAccount = await this.idriss.getConnectedAccount();

if (accounts.length > 0) {
if (selectedAccount) {
let result;

try {
Expand Down Expand Up @@ -470,7 +469,7 @@ export const SendToAnyoneLogic = {
}

// exchanged for redundant multiple get accounts calls
const selectedAccount = this.idriss.getConnectedAccount();
const selectedAccount = await this.idriss.getConnectedAccount();

if (selectedAccount) {
let result;
Expand Down

0 comments on commit 01f6974

Please sign in to comment.