fix(dashboard): add cache-busting and defensive chartManager guards to fix empty charts
This commit is contained in:
@@ -91,6 +91,9 @@ class CostsPage {
|
||||
|
||||
async loadCostsChart() {
|
||||
try {
|
||||
const cm = window.chartManager || await window.waitForChartManager();
|
||||
if (!cm) { this.showEmptyChart('costs-chart', 'Chart system unavailable'); return; }
|
||||
|
||||
const data = await window.api.get('/usage/providers');
|
||||
|
||||
if (!data || data.length === 0) {
|
||||
@@ -107,7 +110,7 @@ class CostsPage {
|
||||
}]
|
||||
};
|
||||
|
||||
window.chartManager.createBarChart('costs-chart', chartData);
|
||||
cm.createBarChart('costs-chart', chartData);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error loading costs chart:', error);
|
||||
|
||||
Reference in New Issue
Block a user