feat: add currency setting with fiat conversion, display prices in user's preferred currency
This commit is contained in:
@@ -17,6 +17,7 @@ class PageListing extends HTMLElement {
|
||||
this.isFavorite = false
|
||||
this.rates = null
|
||||
this.isOwner = false
|
||||
this.handleCurrencyChange = this.handleCurrencyChange.bind(this)
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
@@ -24,10 +25,16 @@ class PageListing extends HTMLElement {
|
||||
this.render()
|
||||
this.loadListing()
|
||||
this.unsubscribe = i18n.subscribe(() => this.render())
|
||||
window.addEventListener('currency-changed', this.handleCurrencyChange)
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
if (this.unsubscribe) this.unsubscribe()
|
||||
window.removeEventListener('currency-changed', this.handleCurrencyChange)
|
||||
}
|
||||
|
||||
handleCurrencyChange() {
|
||||
this.render()
|
||||
}
|
||||
|
||||
async loadListing() {
|
||||
|
||||
Reference in New Issue
Block a user