Skip to content

Commit

Permalink
js: fix wallet wait skipping when balance insufficient
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Jun 16, 2023
1 parent 4a2ba0f commit 36ba3ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/webserver/site/src/html/bodybuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=nV9Bel"></script>
<script src="/js/entry.js?v=XkMuUH"></script>
</body>
</html>
{{end}}
8 changes: 4 additions & 4 deletions client/webserver/site/src/js/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ export default class RegistrationPage extends BasePage {
const wallet = asset.wallet
if (wallet) {
const bondAsset = this.currentDEX.bondAssets[asset.symbol]
if (wallet.synced && wallet.balance.available > bondAsset.amount) {
const bondsFeeBuffer = await this.getBondsFeeBuffer(assetID, page.regAssetForm)
if (wallet.synced && wallet.balance.available > 2 * bondAsset.amount + bondsFeeBuffer) {
this.animateConfirmForm(page.regAssetForm)
return
}
const bondsFeeBuffer = await this.getBondsFeeBuffer(assetID, page.regAssetForm)
this.walletWaitForm.setWallet(wallet, bondsFeeBuffer)
slideSwap(page.regAssetForm, page.walletWait)
return
Expand Down Expand Up @@ -247,12 +247,12 @@ export default class RegistrationPage extends BasePage {
const wallet = asset.wallet
const bondAmt = this.currentDEX.bondAssets[asset.symbol].amount

if (wallet.synced && wallet.balance.available > bondAmt) {
const bondsFeeBuffer = await this.getBondsFeeBuffer(assetID, page.newWalletForm)
if (wallet.synced && wallet.balance.available > 2 * bondAmt + bondsFeeBuffer) {
await this.animateConfirmForm(page.newWalletForm)
return
}

const bondsFeeBuffer = await this.getBondsFeeBuffer(assetID, page.newWalletForm)
this.walletWaitForm.setWallet(wallet, bondsFeeBuffer)
await slideSwap(page.newWalletForm, page.walletWait)
}
Expand Down

0 comments on commit 36ba3ae

Please sign in to comment.