fix coin selection

This commit is contained in:
Kukks 2020-03-24 08:36:27 +01:00
parent e36338d903
commit d0a95f5a69
2 changed files with 9 additions and 1 deletions

View file

@ -447,8 +447,12 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("advancedSettings")).Click();
s.Driver.FindElement(By.Id("toggleInputSelection")).Click();
s.Driver.WaitForElement(By.Id(spentOutpoint.ToString()));
Assert.Equal("true", s.Driver.FindElement(By.Name("InputSelection")).GetAttribute("value").ToLowerInvariant());
var el = s.Driver.FindElement(By.Id(spentOutpoint.ToString()));
s.Driver.FindElement(By.Id(spentOutpoint.ToString())).Click();
var inputSelectionSelect = s.Driver.FindElement(By.Name("SelectedInputs"));
Assert.Equal(1, inputSelectionSelect.FindElements(By.CssSelector("[selected]")).Count);
var bob = new Key().PubKey.Hash.GetAddress(Network.RegTest);
SetTransactionOutput(s, 0, bob, 0.3m);
s.Driver.FindElement(By.Id("SendMenu")).Click();

View file

@ -179,7 +179,11 @@ $(function () {
res.splice(this.selectedInputs.indexOf(item.outpoint),1);
}
$("#SelectedInputs").val(res);
$("select option").each(function(){
var selected = res.indexOf($(this).attr("value")) !== -1;
$(this).attr("selected",selected? "selected": null);
});
this.selectedInputs = res;
$(".crypto-balance-link").text(this.selectedAmount);
}