feat: add currency setting with fiat conversion, display prices in user's preferred currency
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user