Skip to content

Commit

Permalink
fix: disabled withdraw_pin
Browse files Browse the repository at this point in the history
withdraw disabled
  • Loading branch information
dni committed Oct 22, 2024
1 parent 366963a commit 4a26f33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion static/js/tpos.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ window.app = Vue.createApp({
this.cartTax = 0.0
this.total = 0.0
},
activeAtmMode() {
startAtmMode() {
if (this.atmPremium > 0) {
this.exchangeRate = this.exchangeRate / (1 + this.atmPremium)
}
Expand Down
5 changes: 3 additions & 2 deletions templates/tpos/tpos.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ <h5>
</q-page-sticky>
<q-page-sticky position="top-right" :offset="[18, 162]">
<q-btn
@click="activeAtmMode"
@click="startAtmMode"
v-if="withdrawMaximum > 0 && !atmMode"
fab
icon="atm"
Expand Down Expand Up @@ -529,11 +529,12 @@ <h5 v-show="!denomIsSats" class="q-mt-none q-mb-sm">
{% endblock %} {% block scripts %}
<script>
const tpos = JSON.parse({{ tpos | tojson | safe }})
tpos.items = JSON.parse(tpos.items)
tpos.items = tpos.items !== null ? JSON.parse(tpos.items) : []
tpos.tip_options = tpos.tip_options ? JSON.parse(tpos.tip_options) : []
if (tpos.withdraw_maximum) {
tpos.withdraw_premium = Number(tpos.withdraw_maximum / 100)
}
const items = tpos.items
const options = tpos.tip_options
const withdraw_maximum = tpos.withdraw_limit
const withdraw_pin_open = Number('{{ withdraw_pin_open }}')
Expand Down
5 changes: 4 additions & 1 deletion views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ async def tpos(request: Request, tpos_id):
raise HTTPException(
status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist."
)
withdraw_pin_open = tpos.withdraw_pin or 0
withdraw_pin_open = 0
if tpos.withdraw_pin_disabled:
withdraw_pin_open = tpos.withdraw_pin

tpos_clean = TposClean(**tpos.dict())
response = tpos_renderer().TemplateResponse(
"tpos/tpos.html",
Expand Down

0 comments on commit 4a26f33

Please sign in to comment.