feat: add currency setting with fiat conversion, display prices in user's preferred currency

This commit is contained in:
2026-02-05 17:02:03 +01:00
parent 84493942fe
commit 56cf5a63c3
9 changed files with 125 additions and 20 deletions

View File

@@ -15,6 +15,7 @@ class ListingCard extends HTMLElement {
this.isFavorite = false
this.rates = null
this.isOwner = false
this.handleCurrencyChange = this.handleCurrencyChange.bind(this)
}
async connectedCallback() {
@@ -23,6 +24,16 @@ class ListingCard extends HTMLElement {
await this.checkOwnership()
this.render()
this.setupEventListeners()
window.addEventListener('currency-changed', this.handleCurrencyChange)
}
disconnectedCallback() {
window.removeEventListener('currency-changed', this.handleCurrencyChange)
}
handleCurrencyChange() {
this.render()
this.setupEventListeners()
}
async checkOwnership() {