From 5140e437b09aefe68c5df675ee0936cb439c9783 Mon Sep 17 00:00:00 2001 From: DiTus Date: Wed, 25 Feb 2026 22:41:56 +0100 Subject: [PATCH] Fix temporal dead zone error in exports Changed exports to use export { } syntax after function definitions to avoid 'cannot access before initialization' error. Moved export statements to end of file where all functions are defined. --- .../static/js/ui/indicators-panel-new.js | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 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 c94d97c..0d0a489 100644 --- a/src/api/dashboard/static/js/ui/indicators-panel-new.js +++ b/src/api/dashboard/static/js/ui/indicators-panel-new.js @@ -706,20 +706,15 @@ window.removeIndicator = function() { removeIndicatorById(configuringId); }; -// Export functions for module imports -export const addIndicator = window.addIndicator; -export const removeIndicatorById = window.removeIndicatorById; - -// Helper function for remove by index -export function removeIndicatorByIndex(index) { - if (index < 0 || index >= activeIndicators.length) return; - removeIndicatorById(activeIndicators[index].id); -} - // Assign to window for backward compatibility window.toggleIndicator = window.addIndicator; -window.removeIndicatorByIndex = removeIndicatorByIndex; +window.removeIndicatorByIndex = function(index) { + if (index < 0 || index >= activeIndicators.length) return; + removeIndicatorById(activeIndicators[index].id); +}; window.drawIndicatorsOnChart = drawIndicatorsOnChart; -// No additional window assignments needed - functions are already on window -// Exports are now available for module import \ No newline at end of file +// Export functions for module imports +export { window.addIndicator as addIndicator }; +export { window.removeIndicatorById as removeIndicatorById }; +export { window.removeIndicatorByIndex as removeIndicatorByIndex }; \ No newline at end of file