We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f87c7f8 commit bb1b634Copy full SHA for bb1b634
app/views/assistants/show.html.erb
@@ -70,6 +70,22 @@
70
const ctx = document.getElementById('chatsPerDayChart');
71
if (!ctx) return;
72
73
+ // Check if Chart.js is loaded, if not wait for it
74
+ if (typeof Chart === 'undefined') {
75
+ // Wait for Chart.js to load
76
+ const checkChart = setInterval(() => {
77
+ if (typeof Chart !== 'undefined') {
78
+ clearInterval(checkChart);
79
+ createChart(ctx);
80
+ }
81
+ }, 100);
82
+ return;
83
84
+
85
86
87
88
+ function createChart(ctx) {
89
// Destroy existing chart if it exists to prevent duplicates
90
if (window.chatsChart) {
91
window.chatsChart.destroy();
0 commit comments