Fix duplicate variable declarations in setupEventListeners
Remove duplicate button handler declarations for removeBtn, favoriteBtn, etc. The duplicate declarations were causing SyntaxError about 'removeBtn' already declared
This commit is contained in:
@ -403,24 +403,13 @@ function setupEventListeners() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove button
|
// Visibility button (eye)
|
||||||
const removeBtn = e.target.closest('.indicator-btn.remove');
|
const visibleBtn = e.target.closest('.indicator-btn.visible');
|
||||||
if (removeBtn) {
|
if (visibleBtn) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const id = removeBtn.dataset.id;
|
const id = visibleBtn.dataset.id;
|
||||||
if (id && window.removeIndicatorById) {
|
if (id && window.toggleIndicatorVisibility) {
|
||||||
window.removeIndicatorById(id);
|
window.toggleIndicatorVisibility(id);
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Favorite button
|
|
||||||
const favoriteBtn = e.target.closest('.indicator-btn.favorite');
|
|
||||||
if (favoriteBtn) {
|
|
||||||
e.stopPropagation();
|
|
||||||
const type = favoriteBtn.dataset.type;
|
|
||||||
if (type && window.toggleFavorite) {
|
|
||||||
window.toggleFavorite(type);
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user