Skip to content

Commit

Permalink
remove old error or success messages before new tx
Browse files Browse the repository at this point in the history
  • Loading branch information
jasbanza committed Nov 3, 2023
1 parent 53d5159 commit ec90ab1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
28 changes: 15 additions & 13 deletions docs/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -211898,7 +211898,7 @@ function _cancelOrder() {
case 0:
_context11.prev = 0;
if (!window.getOfflineSignerAuto) {
_context11.next = 27;
_context11.next = 29;
break;
}
_context11.next = 4;
Expand Down Expand Up @@ -211941,32 +211941,34 @@ function _cancelOrder() {
modalTitle: "Please Wait"
});
_context11.prev = 15;
_context11.next = 18;
ui_hideResponse();
ui_hideError();
_context11.next = 20;
return client.signAndBroadcast(walletAddress, [msg], gasFee, "by https://jasbanza.github.io/autoswap-cancel-orders");
case 18:
case 20:
result = _context11.sent;
ui_showResponse(result);
ui_removeOrder(orderId);
_context11.next = 26;
_context11.next = 28;
break;
case 23:
_context11.prev = 23;
case 25:
_context11.prev = 25;
_context11.t0 = _context11["catch"](15);
ui_showError(_context11.t0.message);
case 26:
case 28:
ui_hideLoadingMask();
case 27:
_context11.next = 32;
break;
case 29:
_context11.prev = 29;
_context11.next = 34;
break;
case 31:
_context11.prev = 31;
_context11.t1 = _context11["catch"](0);
console.error(_context11.t1);
case 32:
case 34:
case "end":
return _context11.stop();
}
}, _callee11, null, [[0, 29], [15, 23]]);
}, _callee11, null, [[0, 31], [15, 25]]);
}));
return _cancelOrder.apply(this, arguments);
}
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,11 @@ async function cancelOrder(orderId) {
ui_showLoadingMask({ modalMessage: "Broadcasting Transaction...", modalTitle: "Please Wait" });

try {
ui_hideResponse();
ui_hideError();
const result = await client.signAndBroadcast(walletAddress, [msg], gasFee, "by https://jasbanza.github.io/autoswap-cancel-orders");
ui_showResponse(result);
ui_removeOrder(orderId);

} catch (error) {
ui_showError(error.message);
}
Expand Down

0 comments on commit ec90ab1

Please sign in to comment.