Fix temporal dead zone error in filter callback
Moved console.log outside filter callback to avoid accessing 'catalog' variable before it was initialized. The log statement was placed inside the filter callback which creates a temporal dead zone for the variable being assigned.
This commit is contained in:
@ -108,7 +108,6 @@ export function renderIndicatorPanel() {
|
|||||||
|
|
||||||
const available = getAvailableIndicators();
|
const available = getAvailableIndicators();
|
||||||
const catalog = available.filter(ind => {
|
const catalog = available.filter(ind => {
|
||||||
console.log("[IndicatorPanel] Total indicators:", available.length, "Filtered to:", catalog.length);
|
|
||||||
if (searchQuery && !ind.name.toLowerCase().includes(searchQuery.toLowerCase())) return false;
|
if (searchQuery && !ind.name.toLowerCase().includes(searchQuery.toLowerCase())) return false;
|
||||||
if (selectedCategory === 'all') return true;
|
if (selectedCategory === 'all') return true;
|
||||||
if (selectedCategory === 'favorites') return false;
|
if (selectedCategory === 'favorites') return false;
|
||||||
@ -116,6 +115,8 @@ export function renderIndicatorPanel() {
|
|||||||
return cat === selectedCategory;
|
return cat === selectedCategory;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[IndicatorPanel] Total indicators:", available.length, "Filtered to:", catalog.length);
|
||||||
|
|
||||||
const favoriteIds = new Set(userPresets.favorites || []);
|
const favoriteIds = new Set(userPresets.favorites || []);
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
|
|||||||
Reference in New Issue
Block a user