Skip to content

Commit

Permalink
ui: Display order errors on the form.
Browse files Browse the repository at this point in the history
  • Loading branch information
amass01 committed Jun 27, 2021
1 parent fcd3926 commit 7588f5b
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions client/webserver/site/src/js/markets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,6 @@ export default class MarketsPage extends BasePage {
*/
async submitOrder () {
const page = this.page
const market = this.market
Doc.hide(page.forms)
const order = this.parseOrder()
const pw = page.vPass.value
Expand All @@ -1313,14 +1312,10 @@ export default class MarketsPage extends BasePage {
}
if (!this.validateOrder(order)) return
const res = await postJSON('/api/trade', req)
if (!app.checkResponse(res)) return
// If the wallets are not open locally, they must have been opened during
// ordering. Grab updated info.
const baseWallet = app.walletMap[market.base.id]
const quoteWallet = app.walletMap[market.quote.id]
if (!baseWallet.open || !quoteWallet.open) {
this.balanceWgt.updateAsset(market.base.id)
this.balanceWgt.updateAsset(market.quote.id)
if (!app.checkResponse(res, true)) {
page.orderErr.textContent = res.msg
Doc.show(page.orderErr)
return
}
this.refreshActiveOrders()
this.chart.draw()
Expand Down

0 comments on commit 7588f5b

Please sign in to comment.