diff --git a/app/js/index.js b/app/js/index.js
index d23af1ea..fcb20b7f 100644
--- a/app/js/index.js
+++ b/app/js/index.js
@@ -473,9 +473,9 @@ var UI = (function(UI, undefined) {
select.addEventListener("change", function(e) {
e.preventDefault();
if (this.value == "custom") {
- document.getElementById("server_config_host").style.display = "none";
+ document.getElementById("custom_light_wallet").style.display = "block";
} else {
- document.getElementById("server_config_host").style.display = "none";
+ document.getElementById("custom_light_wallet").style.display = "none";
}
});
} else {
@@ -500,12 +500,11 @@ var UI = (function(UI, undefined) {
content = "
" +
"";
+ var found = false;
if (configuration.lightWalletHosts && configuration.lightWalletHosts.length) {
content += "";
content += "
";
- content += "";
- } else {
- content += "";
}
+ var hostValue = "";
+ if(!found && configuration.lightWalletHost) {
+ hostValue += UI.format(configuration.lightWalletHost);
+ if(configuration.lightWalletPort) {
+ hostValue += ":" + UI.format(configuration.lightWalletPort);
+ }
+ }
+
+ var lwUser = configuration.lightWalletUser ? UI.format(configuration.lightWalletUser) : '';
+ var lwPassword = configuration.lightWalletPassword ? UI.format(configuration.lightWalletUPassword) : '';
+
+ content += "";
+
content += "" +
"
";
} else {
@@ -567,10 +586,14 @@ var UI = (function(UI, undefined) {
var selectedHost;
var select = document.getElementById("server_config_host_select");
+ var username = "";
+ var password = "";
if (select) {
var selectedHost = select.options[select.selectedIndex].value;
if (selectedHost == "custom") {
selectedHost = document.getElementById("server_config_host").value;
+ username = document.getElementById("light_wallet_user").value;
+ password = document.getElementById("light_wallet_password").value;
}
} else {
selectedHost = document.getElementById("server_config_host").value;
@@ -586,6 +609,8 @@ var UI = (function(UI, undefined) {
config.lightWalletHost = res[1];
config.lightWalletPort = res[2];
+ config.lightWalletUser = username;
+ config.lightWalletPassword = password;
config.minWeightMagnitude = parseInt(document.getElementById("server_config_min_weight_magnitude").value, 10);
} else {
config.port = parseInt(document.getElementById("server_config_port").value, 10);