fix: security hardening + code quality improvements (401 retry limit, UUID crypto, debounce this-bug, deduplicate CSS/helpers, optimize SW precache)
This commit is contained in:
@@ -73,13 +73,13 @@ export function setupGlobalErrorHandler() {
|
||||
|
||||
// Don't show UI for script loading errors
|
||||
if (event.filename && event.filename.includes('.js')) {
|
||||
showErrorToast(event.message || 'Ein Fehler ist aufgetreten')
|
||||
showErrorToast(event.message || t('common.error'))
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('unhandledrejection', (event) => {
|
||||
console.error('Unhandled promise rejection:', event.reason)
|
||||
showErrorToast(event.reason?.message || 'Ein Fehler ist aufgetreten')
|
||||
showErrorToast(event.reason?.message || t('common.error'))
|
||||
})
|
||||
|
||||
// Offline/Online detection
|
||||
|
||||
@@ -4,8 +4,6 @@ import { getXmrRates, formatPrice as formatCurrencyPrice } from '../services/cur
|
||||
import { auth } from '../services/auth.js'
|
||||
import { favoritesService } from '../services/favorites.js'
|
||||
|
||||
let cachedRates = null
|
||||
|
||||
class ListingCard extends HTMLElement {
|
||||
static get observedAttributes() {
|
||||
return ['listing-id', 'title', 'price', 'currency', 'location', 'image', 'owner-id', 'payment-status', 'status', 'priority']
|
||||
@@ -53,10 +51,7 @@ class ListingCard extends HTMLElement {
|
||||
}
|
||||
|
||||
async loadRates() {
|
||||
if (!cachedRates) {
|
||||
cachedRates = await getXmrRates()
|
||||
}
|
||||
this.rates = cachedRates
|
||||
this.rates = await getXmrRates()
|
||||
}
|
||||
|
||||
attributeChangedCallback() {
|
||||
|
||||
Reference in New Issue
Block a user