Skip to content

Commit

Permalink
fix: show BTC instead of sats for onchain (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 authored Aug 9, 2024
1 parent 934fba4 commit 8477b0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
13 changes: 10 additions & 3 deletions static/js/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ Vue.component('satspay-show-qr', {
<div class="row justify-center q-mb-sm">
<div class="col text-center">
<span v-if="type == 'btc'" class="text-subtitle2">Send
<span v-text="chargeAmount"></span>
sats to this onchain address</span>
<strong>
<span v-text="chargeAmountBtc"></span> BTC
</strong>
to this onchain address</span>
<span v-if="type == 'ln'" class="text-subtitle2">Pay this lightning-network invoice:</span>
<span v-if="type == 'uqr'" class="text-subtitle2">Scan QR with a wallet supporting BIP21:</span>
</div>
Expand All @@ -58,7 +60,12 @@ Vue.component('satspay-show-qr', {
<q-btn outline color="grey" @click="copyText(value)">Copy address</q-btn>
</div>
</div>
</div>`
</div>`,
computed: {
chargeAmountBtc() {
return (this.chargeAmount / 1e8).toFixed(8)
}
}
})

Vue.component('satspay-time-elapsed', {
Expand Down
11 changes: 5 additions & 6 deletions templates/satspay/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,13 @@
clearInterval(this.timerInterval)

// Check if redirection hasn't already occurred
if (redirectToCompleteLink && this.charge.completelink) {
redirectToCompleteLink = false;
window.location.href = this.charge.completelink;
if (redirectToCompleteLink && this.charge.completelink) {
redirectToCompleteLink = false
window.location.href = this.charge.completelink
}
}
this.timer += 0.25;
}
, 12.5)
this.timer += 0.25
}, 12.5)
}
} catch (error) {
LNbits.utils.notifyApiError(error)
Expand Down

0 comments on commit 8477b0a

Please sign in to comment.