Skip to content

Commit f218fba

Browse files
committed
fix: use suggested geoData guard condition from PR review
1 parent 02c6420 commit f218fba

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/js/techreport/geoBreakdown.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,7 @@ class GeoBreakdown {
5959
}
6060

6161
renderTable() {
62-
const container = document.getElementById(`${this.id}-table`);
63-
if (!this.geoData || !this.geoData.length) {
64-
if (container) container.textContent = 'No geographic data available.';
65-
return;
66-
}
62+
if (!this.geoData || !this.geoData.length || this.geoData.length === 0) return;
6763

6864
const component = document.querySelector(`[data-id="${this.id}"]`);
6965
const client = component?.dataset?.client || 'mobile';
@@ -112,6 +108,7 @@ class GeoBreakdown {
112108
const limited = this.showAll ? sorted : sorted.slice(0, 10);
113109
const entries = this.sortEntries(limited);
114110

111+
const container = document.getElementById(`${this.id}-table`);
115112
if (!container) return;
116113

117114
const table = document.createElement('table');

0 commit comments

Comments
 (0)