diff --git a/static/js/index.js b/static/js/index.js index a2878c8..12bcb7b 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -1013,7 +1013,7 @@ window.app = Vue.createApp({ paymentHash: null, checkWalletKey: null, pollIntervalId: null, - exchangeRate: fiatAmount > 0 ? Math.abs(userBalance.balance) / fiatAmount : (this.currentExchangeRate || 3571.43), // Calculate rate from actual amounts or use current rate + exchangeRate: fiatAmount > 0 ? Math.abs(userBalance.balance) / fiatAmount : this.currentExchangeRate, // Calculate rate from actual amounts or use current rate originalCurrency: fiatCurrency || 'BTC' } }, @@ -1214,7 +1214,7 @@ window.app = Vue.createApp({ reference: '', loading: false, paymentSuccess: false, - exchangeRate: fiatAmount > 0 ? userBalance.balance / fiatAmount : (this.currentExchangeRate || 3571.43), + exchangeRate: fiatAmount > 0 ? userBalance.balance / fiatAmount : this.currentExchangeRate, originalCurrency: fiatCurrency || 'BTC' } }, @@ -1374,9 +1374,12 @@ window.app = Vue.createApp({ } } catch (error) { console.error('Error loading exchange rate:', error) - // Fallback to a reasonable default if API fails - this.currentExchangeRate = 3571.43 - console.log('Using fallback exchange rate:', this.currentExchangeRate) + this.currentExchangeRate = null + this.$q.notify({ + type: 'warning', + message: 'Failed to load exchange rate. Fiat currency conversions may not be available.', + timeout: 5000 + }) } }, formatSats(amount) {