diff --git a/src/api/dashboard/static/js/ui/chart.js b/src/api/dashboard/static/js/ui/chart.js index 219c4d8..a7f7024 100644 --- a/src/api/dashboard/static/js/ui/chart.js +++ b/src/api/dashboard/static/js/ui/chart.js @@ -499,7 +499,7 @@ async loadTA() { } } - renderTA() { +renderTA() { if (!this.taData || this.taData.error) { document.getElementById('taContent').innerHTML = `
${this.taData?.error || 'No data available'}
`; return; @@ -542,23 +542,7 @@ async loadTA() { - -
-
Indicators
-
-
- -
-
Configuration
-
-
- - -
-
`; - - window.renderIndicatorList?.(); } async loadStats() { diff --git a/src/api/dashboard/static/js/ui/indicators-panel-new.js b/src/api/dashboard/static/js/ui/indicators-panel-new.js index d61f0ce..4cd2cfd 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -496,16 +496,27 @@ window.clearAllIndicators = function() { } function removeIndicatorById(id) { + console.log(`[removeIndicatorById] Attempting to remove indicator: ${id}`); + console.log('Call stack:', console.trace()); + const idx = activeIndicators.findIndex(a => a.id === id); - if (idx < 0) return; + if (idx < 0) { + console.warn(`[removeIndicatorById] Indicator ${id} not found in array`); + return; + } + + console.log(`[removeIndicatorById] Removing indicator at index ${idx}`); activeIndicators[idx].series?.forEach(s => { try { window.dashboard?.chart?.removeSeries(s); } catch(e) {} }); + // Remove the specific indicator, don't clear the whole array activeIndicators.splice(idx, 1); -if (configuringId === id) { + console.log(`[removeIndicatorById] After removal, array now has ${activeIndicators.length} indicators`); + + if (configuringId === id) { configuringId = null; } @@ -794,6 +805,12 @@ export function drawIndicatorsOnChart() { return; } + if (activeIndicators.length === 0) { + console.error('⚠️ drawIndicatorsOnChart: activeIndicators is EMPTY!'); + console.error('⚠️ This means indicators were lost during TF switch!'); + console.trace('Call stack showing where we are:'); + } + const currentInterval = window.dashboard.currentInterval; const candles = window.dashboard.allData.get(currentInterval);