Skip to content

Commit

Permalink
Merge pull request #29 from alexmpa/fix-link-connection-to-closed-wallet
Browse files Browse the repository at this point in the history
Fix link connection to a closed account
  • Loading branch information
Relfos authored Apr 9, 2020
2 parents e5bfb71 + f75210a commit 3a09e0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/Scripts/Wallet/AccountManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public class AccountManager : MonoBehaviour
public int CurrentIndex => _selectedAccountIndex;
public Account CurrentAccount => HasSelection ? Accounts[_selectedAccountIndex] : new Account() { };

public bool HasSelection => _selectedAccountIndex < Accounts.Length;
public bool HasSelection => _selectedAccountIndex >= 0 && _selectedAccountIndex < Accounts.Length;

private Dictionary<PlatformKind, AccountState> _states = new Dictionary<PlatformKind, AccountState>();
private Dictionary<PlatformKind, HistoryEntry[]> _history = new Dictionary<PlatformKind, HistoryEntry[]>();
Expand Down Expand Up @@ -651,6 +651,10 @@ public void SelectAccount(int index)
public void UnselectAcount()
{
_selectedAccountIndex = -1;

_accountInitialized = false;

_states.Clear();
}

private void ReportWalletBalance(PlatformKind platform, AccountState state)
Expand Down

0 comments on commit 3a09e0f

Please sign in to comment.