From 86748c331702bd1627bcbf9a81ca197440861bad Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Wed, 7 Aug 2024 17:03:25 -0700 Subject: [PATCH] js lint --- app/assets/javascripts/totalMessagesChart.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/totalMessagesChart.js b/app/assets/javascripts/totalMessagesChart.js index 0ccbf71e8..ff409c969 100644 --- a/app/assets/javascripts/totalMessagesChart.js +++ b/app/assets/javascripts/totalMessagesChart.js @@ -22,7 +22,12 @@ var svg = d3.select("#totalMessageChart"); var width = chartContainer.clientWidth; var height = 64; - console.log('update') + + // Ensure the width is set correctly + if (width === 0) { + console.error('Chart container width is 0, cannot set SVG width.'); + return; + } svg.attr("width", width).attr("height", height);