Skip to content

Commit 6b31d80

Browse files
WezSieTatoCopilot
andauthored
the section when the last tile is removed to avoid showing a blank section.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 9ce3bb9 commit 6b31d80

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

popup/pola.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@
194194
const img = document.createElement('img');
195195
img.src = brand.logotype_url;
196196
img.alt = brand.name || '';
197-
img.addEventListener('error', () => tile.remove());
197+
img.addEventListener('error', () => {
198+
tile.remove();
199+
if (grid.childElementCount === 0) {
200+
section.hidden = true;
201+
}
202+
});
198203
if (this.isRealUrl(brand.website_url)) {
199204
const a = document.createElement('a');
200205
a.href = brand.website_url;

0 commit comments

Comments
 (0)