Add more diagnostic logging to track activeIndicators array lifecycle
- Log when module is loaded - Log when setActiveIndicators is called - Log when clearAllIndicators is called - Show call stacks for debugging
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import { getAvailableIndicators, IndicatorRegistry as IR } from '../indicators/index.js';
|
||||
|
||||
console.log('[Module] indicators-panel-new.js loaded - activeIndicators count:', activeIndicators?.length || 0);
|
||||
|
||||
// State management
|
||||
let activeIndicators = [];
|
||||
let configuringId = null;
|
||||
@ -96,6 +98,8 @@ export function getActiveIndicators() {
|
||||
}
|
||||
|
||||
export function setActiveIndicators(indicators) {
|
||||
console.warn('setActiveIndicators() called with', indicators.length, 'indicators - this will replace activeIndicators array!');
|
||||
console.trace('Call stack:');
|
||||
activeIndicators = indicators;
|
||||
renderIndicatorPanel();
|
||||
}
|
||||
@ -476,6 +480,8 @@ window.updateIndicatorSetting = function(id, key, value) {
|
||||
};
|
||||
|
||||
window.clearAllIndicators = function() {
|
||||
console.warn('clearAllIndicators() called - clearing all indicators!');
|
||||
console.trace('Call stack:');
|
||||
activeIndicators.forEach(ind => {
|
||||
ind.series?.forEach(s => {
|
||||
try { window.dashboard?.chart?.removeSeries(s); } catch(e) {}
|
||||
|
||||
Reference in New Issue
Block a user