subagent thinking accordion; indicator fixes; script details & edit
This commit is contained in:
@@ -32,19 +32,10 @@ let symbolWatcher: WatchStopHandle | null = null
|
||||
|
||||
const maybeInitChart = () => {
|
||||
if (chartInitialized || !chartContainer.value) return
|
||||
if (!chartStore.symbol) {
|
||||
// Defer until backend provides a symbol
|
||||
if (!symbolWatcher) {
|
||||
symbolWatcher = watch(() => chartStore.symbol, (sym) => {
|
||||
if (sym) {
|
||||
symbolWatcher?.()
|
||||
symbolWatcher = null
|
||||
maybeInitChart()
|
||||
}
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
// If the workspace persisted null values (bad state), reset to defaults immediately
|
||||
// rather than deferring forever. This also syncs the reset back to the container.
|
||||
if (!chartStore.symbol) chartStore.symbol = 'BTC/USDT.BINANCE'
|
||||
if (!chartStore.period) chartStore.period = 900
|
||||
chartInitialized = true
|
||||
initChart()
|
||||
}
|
||||
@@ -73,7 +64,7 @@ function initChart() {
|
||||
tvWidget = new window.TradingView.widget({
|
||||
symbol: chartStore.symbol, // Use symbol from store
|
||||
datafeed: datafeed,
|
||||
interval: secondsToInterval(chartStore.period) as any,
|
||||
interval: secondsToInterval(chartStore.period || 900) as any,
|
||||
container: chartContainer.value!,
|
||||
library_path: '/charting_library/',
|
||||
locale: 'en',
|
||||
|
||||
Reference in New Issue
Block a user