Skip to content

Commit

Permalink
Remove old Send Selected Coins feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ichthus1604 committed Apr 26, 2024
1 parent 92d70e6 commit b3794e7
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 403 deletions.
166 changes: 0 additions & 166 deletions WalletWasabi.Fluent/ViewModels/Dialogs/AddressEntryDialogViewModel.cs

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private WalletCoinsViewModel(IWalletModel wallet)
_wallet = wallet;
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
NextCommand = CancelCommand;
SkipCommand = ReactiveCommand.CreateFromTask(OnSendCoinsAsync);

_coinList = new CoinListViewModel(_wallet, _wallet.Coins, new List<ICoinModel>());
IsAnySelected = CoinList.Selection.ToObservableChangeSet().Count().Select(i => i > 0);
}
Expand All @@ -59,43 +59,4 @@ protected override void OnNavigatedFrom(bool isInHistory)
CoinList.Dispose();
}
}

private async Task OnSendCoinsAsync()
{
// TODO: Leaky abstraction. SmartCoin shouldn't be exposed here.
// What we need is a TransactionInfo that can operate with ICoinModel instead.
var selectedSmartCoins =
CoinList.Selection
.Select(x => x.GetSmartCoin())
.ToImmutableArray();

var addressResult = await Navigate().To().AddressEntryDialog(_wallet.Network).GetResultAsync();
if (addressResult is not { } address || address.Address is null)
{
return;
}

var labelsResult = await Navigate().To().LabelEntryDialog(_wallet, address.Label ?? LabelsArray.Empty).GetResultAsync();
if (labelsResult is not { } label)
{
return;
}

var info = new TransactionInfo(address.Address, _wallet.Settings.AnonScoreTarget)
{
Coins = selectedSmartCoins,
Amount = selectedSmartCoins.Sum(x => x.Amount),
SubtractFee = true,
Recipient = label,
IsSelectedCoinModificationEnabled = false,
IsFixedAmount = true
};

// TODO: Remove this after TransactionPreviewViewModel is decoupled.
var walletVm = MainViewModel.Instance.NavBar.Wallets.First(x => x.Wallet.WalletName == _wallet.Name).WalletViewModel;
if (walletVm is null)
{
return;
}
}
}
66 changes: 0 additions & 66 deletions WalletWasabi.Fluent/Views/Dialogs/AddressEntryDialogView.axaml

This file was deleted.

17 changes: 0 additions & 17 deletions WalletWasabi.Fluent/Views/Dialogs/AddressEntryDialogView.axaml.cs

This file was deleted.

Loading

0 comments on commit b3794e7

Please sign in to comment.