Skip to content

Commit

Permalink
- coinjoin tab shows warning if no coins are selected on dequeue button
Browse files Browse the repository at this point in the history
  • Loading branch information
molnard committed Dec 16, 2018
1 parent 3d43b82 commit ef99438
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public CoinJoinTabViewModel(WalletViewModel walletViewModel)

DequeueCommand = ReactiveCommand.Create(async () =>
{
if (!CoinsList.Coins.Any(c => c.IsSelected))
{
SetWarningMessage("No coins are selected to dequeue.");
return;
}
await DoDequeueAsync(CoinsList.Coins.Where(c => c.IsSelected));
});

Expand Down Expand Up @@ -330,7 +335,7 @@ public string Password
public CoinListViewModel CoinsList
{
get { return _coinsList; }
set
set
{
bool changed = _coinsList != value;
if (_coinsList != null) _coinsList.DequeueCoinsPressed -= CoinsList_DequeueCoinsPressedAsync;
Expand All @@ -340,6 +345,7 @@ public CoinListViewModel CoinsList
}

#pragma warning disable RECS0165 // Asynchronous methods should return a Task instead of void

private async void CoinsList_DequeueCoinsPressedAsync()
#pragma warning restore RECS0165 // Asynchronous methods should return a Task instead of void
{
Expand Down

0 comments on commit ef99438

Please sign in to comment.