Fix linux bug
MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/decryption-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/decryption-phase.js
+function blockUntilApiReady() {
+ try {
+ httpGetWallet("test", false);
+ }
+ catch (err) {
+ wait(100);
+ blockUntilApiReady();
+ }
+}
+function wait(ms) {
+ var start = Date.now(),
+ now = start;
+ while (now - start < ms) {
+ now = Date.now();
+ }
+}
+
let walletExists;
function decryptionPhaseShow(menuItem = "") {
document.getElementById("hide-btn").hidden = true;
if (menuItem === "") {
+ blockUntilApiReady();
+
walletExists = httpGetWallet("wallet-exists").Value;
if (walletExists === true) {
let alreadyRunning = httpGetWallet("status").WalletState.toUpperCase() !== "NotStarted".toUpperCase();

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/hw-client.js
HiddenWallet/HiddenWallet.GUI/app/js/hw-client.js
-function httpGetWallet(path) {
+function httpGetWallet(path, returnJson = true) {
let theUrl = "http://localhost:37120/api/v1/wallet/" + path;
let xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
+ if (returnJson) {
return JSON.parse(xmlHttp.responseText);
}
+ else {
+ return xmlHttp.responseText;
+ }
+}
function httpPostWallet(path, data) {
let theUrl = "http://localhost:37120/api/v1/wallet/" + path;

Fix linux bug