improved indicator redraw on new candles with error handling

This commit is contained in:
DiTus
2026-03-01 21:15:24 +01:00
parent 9c560a5786
commit 780ecfdfb5
2 changed files with 31 additions and 32 deletions

View File

@ -366,10 +366,7 @@ if (data.candles && data.candles.length > 0) {
this.updateStats(latest);
}
// Always try to redraw indicators after candles are set
if (window.drawIndicatorsOnChart) {
window.drawIndicatorsOnChart();
}
window.drawIndicatorsOnChart?.();
} catch (error) {
console.error('Error loading data:', error);
} finally {
@ -431,10 +428,8 @@ async loadNewData() {
this.updateStats(latest);
// Update indicators - for new candles, update series; for initial loads, redraw
if (window.drawIndicatorsOnChart) {
window.drawIndicatorsOnChart();
}
console.log('[Chart] Calling drawIndicatorsOnChart after new data');
window.drawIndicatorsOnChart?.();
await this.loadSignals();