From 87b7cea567b5989311e29fb342fb588e3ee423e4 Mon Sep 17 00:00:00 2001 From: DiTus Date: Sun, 1 Mar 2026 22:53:18 +0100 Subject: [PATCH] fixed: check pane element exists before observing --- .../static/js/ui/indicators-panel-new.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/api/dashboard/static/js/ui/indicators-panel-new.js b/src/api/dashboard/static/js/ui/indicators-panel-new.js index c472733..a6bcb7e 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -962,17 +962,20 @@ export function drawIndicatorsOnChart() { // Subscribe to pane height changes to save to localStorage const originalHeight = storedHeight; - const resizeObserver = new ResizeObserver((entries) => { - for (const entry of entries) { - const newHeight = Math.round(entry.contentRect.height); - if (newHeight !== originalHeight && newHeight > 50) { - indicator.paneHeight = newHeight; - localStorage.setItem(`pane_height_${indicator.type}`, newHeight); - console.log(`[Indicators] Saved pane height for ${indicator.type}: ${newHeight}px`); + const paneElement = pane.getHTMLElement && pane.getHTMLElement(); + if (paneElement) { + const resizeObserver = new ResizeObserver((entries) => { + for (const entry of entries) { + const newHeight = Math.round(entry.contentRect.height); + if (newHeight !== originalHeight && newHeight > 50) { + indicator.paneHeight = newHeight; + localStorage.setItem(`pane_height_${indicator.type}`, newHeight); + console.log(`[Indicators] Saved pane height for ${indicator.type}: ${newHeight}px`); + } } - } - }); - resizeObserver.observe(pane.getHTMLElement()); + }); + resizeObserver.observe(paneElement); + } } });