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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user