fix: optional chaining cannot be used for assignment

Fixed syntax error where optional chaining (?.) was used for assignment
in updateStats method. Changed to use if checks for null-protection.
This commit is contained in:
TenerifeProp Dev
2026-04-05 12:49:10 +01:00
parent 33503d4437
commit 86e4b2a31e

View File

@@ -614,9 +614,12 @@ class TenerifeProp {
try {
const res = await API.getStats()
if (res.success) {
document.getElementById('statViews')?.textContent = this.formatNumber(res.data.totalViews)
document.getElementById('statLeads')?.textContent = this.formatNumber(res.data.totalLeads)
document.getElementById('statProperties')?.textContent = this.formatNumber(res.data.activeProperties)
const viewsEl = document.getElementById('statViews')
const leadsEl = document.getElementById('statLeads')
const propsEl = document.getElementById('statProperties')
if (viewsEl) viewsEl.textContent = this.formatNumber(res.data.totalViews)
if (leadsEl) leadsEl.textContent = this.formatNumber(res.data.totalLeads)
if (propsEl) propsEl.textContent = this.formatNumber(res.data.activeProperties)
}
} catch (e) {
console.error('Failed to load stats:', e)