From fb5659de2a23239bd38f43bdd6275a47fbe1c3e5 Mon Sep 17 00:00:00 2001 From: arcbtc Date: Wed, 18 Dec 2024 23:19:03 +0000 Subject: [PATCH] working, also fixed the button --- lnbits/core/templates/core/wallet.html | 25 ++++++++++++------ lnbits/static/js/components.js | 2 +- lnbits/static/js/wallet.js | 35 +++++++++++++++----------- lnbits/templates/components.vue | 26 ++++++++++++++++++- 4 files changed, 64 insertions(+), 24 deletions(-) diff --git a/lnbits/core/templates/core/wallet.html b/lnbits/core/templates/core/wallet.html index 4411661f8..e707b1a4c 100644 --- a/lnbits/core/templates/core/wallet.html +++ b/lnbits/core/templates/core/wallet.html @@ -36,7 +36,7 @@
-
+
@@ -70,7 +74,7 @@
-
+
-
+
BTC Price
@@ -143,6 +151,7 @@
+
-
+
{ this.fiatBalance = - (response.data.rate / 100000000) * - (this.g.wallet.sat) - this.exchangeRate = response.data.rate.toFixed(2) + (response.data.price / 100000000) * + (this.balance || this.g.wallet.sat) + this.exchangeRate = response.data.price.toFixed(2) this.fiatTracking = true this.formatFiatAmount(this.fiatBalance, currency) this.$q.localStorage.set('lnbits.exchangeRate', this.exchangeRate) @@ -675,7 +677,7 @@ window.app = Vue.createApp({ }, handleFiatTracking() { if (this.fiatTracking === false) { - this.updateWallet({ currency: ''}) + this.update.currency = '' this.$q.localStorage.setItem( 'lnbits.isPrioritySwapped', false @@ -695,7 +697,11 @@ window.app = Vue.createApp({ if (this.$q.screen.lt.md) { this.mobileSimple = true } + setTimeout(() => { + this.ignoreWatcher = false + }, 3000) if(this.g.wallet.currency){ + this.fiatTracking = true this.updateFiatBalance(this.g.wallet.currency) } this.update.name = this.g.wallet.name @@ -711,6 +717,7 @@ window.app = Vue.createApp({ this.fetchBalance() }, 'update.currency'(newValue) { + if (this.ignoreWatcher) return this.updateWallet({ currency: newValue }) this.updateFiatBalance(newValue) } diff --git a/lnbits/templates/components.vue b/lnbits/templates/components.vue index 955670aed..195ecd729 100644 --- a/lnbits/templates/components.vue +++ b/lnbits/templates/components.vue @@ -506,7 +506,31 @@