beautify error messages
MODIFY
HiddenWallet.Gui/app/js/broadcast-window.ts
HiddenWallet.Gui/app/js/broadcast-window.ts
@@ -346,11 +346,10 @@ function rebuildTransaction() {
try {
alertMessage += ": " + json.Message;
- if (!isBlank(json.Details)) {
- alertMessage = `${alertMessage}
-
- Details:
- ${json.Details}`;
+ if (json.Details) {
+ alertMessage = alertMessage
+ + "\n"
+ + "\n" + json.Details;
}
} catch {
@@ -389,10 +388,9 @@ function broadcastTransaction() {
try {
alertMessage = alertMessage + json.Message;
if (json.Details) {
- alertMessage =
- `${alertMessage}
-
-Details: ${json.Details}`;
+ alertMessage = alertMessage
+ + "\n"
+ + "\n" + json.Details;
}
} catch{ }

MODIFY
HiddenWallet.Gui/app/js/wallet-phase.ts
HiddenWallet.Gui/app/js/wallet-phase.ts
@@ -284,7 +284,7 @@ function mix() {
try {
alertMessage += ": " + json.Message;
- if (!isBlank(json.Details)) {
+ if (json.Details) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
@@ -325,7 +325,7 @@ function cancelMix()
try {
alertMessage += ": " + json.Message;
- if (!isBlank(json.Details)) {
+ if (json.Details) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
@@ -578,7 +578,7 @@ function buildTransaction() {
try {
alertMessage += ": " + json.Message;
- if (!isBlank(json.Details)) {
+ if (json.Details) {
alertMessage = alertMessage
+ "\n"
+ "\n" + json.Details;
@@ -608,10 +608,6 @@ function buildTransaction() {
});
}
-function isBlank(str: string) {
- return (!str || /^\s*$/.test(str));
-}
-
function getPhaseName(phase: string): string {
let phaseName: string;

beautify error messages