Skip to content
Permalink
Browse files

put , between if the user wants to add multiple labels

  • Loading branch information...
nopara73 committed Nov 13, 2018
1 parent f9d1934 commit 3a0f08ae41372f4a35c5d72d2297171b17861c60
@@ -59,7 +59,8 @@ public ReceiveTabViewModel(WalletViewModel walletViewModel)

Dispatcher.UIThread.Post(() =>
{
HdPubKey newKey = Global.WalletService.GetReceiveKey(Label, Addresses.Select(x => x.Model).Take(7)); // Never touch the first 7 keys.
var label = Label.Trim().Trim(',').Trim();
HdPubKey newKey = Global.WalletService.GetReceiveKey(label, Addresses.Select(x => x.Model).Take(7)); // Never touch the first 7 keys.

AddressViewModel found = Addresses.FirstOrDefault(x => x.Model == newKey);
if (found != default)
@@ -73,7 +74,7 @@ public ReceiveTabViewModel(WalletViewModel walletViewModel)

SelectedAddress = newAddress;

Label = string.Empty;
Label = "";
});
});
this.WhenAnyValue(x => x.Label).Subscribe(x => UpdateSuggestions(x));
@@ -178,7 +179,7 @@ private void UpdateSuggestions(string words)
return;
}

string[] enteredWordList = words.Split(' ', StringSplitOptions.RemoveEmptyEntries);
var enteredWordList = words.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim());
var lastWorld = enteredWordList.LastOrDefault().Replace("\t", "");

if (lastWorld.Length < 1)
@@ -201,15 +202,15 @@ private void UpdateSuggestions(string words)

public void OnAddWord(string word)
{
string[] words = Label.Split(' ', StringSplitOptions.RemoveEmptyEntries);
var words = Label.Split(',', StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToArray();
if (words.Length == 0)
{
Label = word + " ";
Label = word + ", ";
}
else
{
words[words.Length - 1] = word;
Label = string.Join(' ', words) + " ";
Label = string.Join(", ", words) + ", ";
}

CaretIndex = Label.Length;
@@ -130,7 +130,8 @@ public SendTabViewModel(WalletViewModel walletViewModel)
return;
}
}
var operation = new WalletService.Operation(script, amount, Label);
var label = Label.Trim().Trim(',').Trim();
var operation = new WalletService.Operation(script, amount, label);

var result = await Task.Run(async () => await Global.WalletService.BuildTransactionAsync(Password, new[] { operation }, Fee, allowUnconfirmed: true, allowedInputs: selectedCoins));

0 comments on commit 3a0f08a

Please sign in to comment.
You can’t perform that action at this time.