@@ -128,7 +128,7 @@ async function warmBaseChart(){
128128}
129129async function loadChart (silent = false ){
130130 const nextContext = chartContextSignature ()
131- if (displayedChartContext .value !== snapshotContext ())warmBaseChart ()
131+ if (displayedChartContext .value !== snapshotContext ())void warmBaseChart ()
132132 if (chartRefreshing .value ){
133133 if (silent&& nextContext=== activeChartRequestContext)return
134134 queuedChartLoadSilent= queuedChartLoad? queuedChartLoadSilent&& silent: silent
@@ -159,7 +159,7 @@ async function selectIndicator(item){
159159function selectSymbol (item ){form .market = item .market || ' Crypto' ;form .symbol = item .symbol ;if (form .market .toLowerCase ()=== ' crypto' ){form .exchangeId = item .exchange_id || form .exchangeId ;form .marketType = item .market_type || form .marketType ;selectedProduct .value = {symbol: form .symbol ,exchange_id: form .exchangeId ,market_type: form .marketType ,instrument_id: item .instrument_id || ' ' ,settle_currency: item .settle_currency || ' ' ,product_type: item .product_type || ' ' ,api_family: item .api_family || ' ' ,underlying_market: item .underlying_market || ' ' ,underlying_symbol: item .underlying_symbol || ' ' ,product_meta: item .product_meta || null }}else selectedProduct .value = null ;loadChart ()}
160160function onTradeContextChange (context ){if (! context .exchangeId )return ;if (context .exchangeId === form .exchangeId && context .marketType === form .marketType )return ;form .exchangeId = context .exchangeId ;form .marketType = context .marketType ;loadChart ()}
161161function openAi (){router .push ({path: ' /ai' ,query: {symbol: form .symbol ,market: form .market ,timeframe: form .timeframe }})}
162- async function bootstrap (){warmBaseChart ();try {const loaded = await indicatorApi .getList ();indicators .value = loaded .data || [];const id = Number (route .query .indicator_id || route .query .local_copy_id || 0 );const preferred = indicators .value .find (x => Number (x .id )=== id)|| indicators .value [0 ];if (preferred)await selectIndicator ({indicatorId: Number (preferred .id )});else await loadChart ()}catch (e){if (! chartData .value ? .candles ? .length ){error .value = e? .localizedMessage || e? .message || t (' audit.loadFailed' );await warmBaseChart ()}}}
162+ async function bootstrap (){void warmBaseChart ();try {const loaded = await indicatorApi .getList ();indicators .value = loaded .data || [];const id = Number (route .query .indicator_id || route .query .local_copy_id || 0 );const preferred = indicators .value .find (x => Number (x .id )=== id)|| indicators .value [0 ];if (preferred)await selectIndicator ({indicatorId: Number (preferred .id )});else await loadChart ()}catch (e){if (! chartData .value ? .candles ? .length ){error .value = e? .localizedMessage || e? .message || t (' audit.loadFailed' );await warmBaseChart ()}}}
163163function stopStream (){streamGeneration++ ;stream? .disconnect ();stream= null ;lastTick= 0 ;pendingBar= null }
164164function startStream (){
165165 stopStream ()
@@ -177,15 +177,15 @@ function startStream(){
177177 if (result=== ' ignored' )return
178178 lastTick= Date .now ();updated .value = lastTick
179179 marketChart .value ? .updateBar (bar)
180- if (bar .isClosed )loadChart (true )
180+ if (bar .isClosed )void loadChart (true )
181181 },
182182 onError (){if (generation=== streamGeneration){lastTick= 0 ;requestRecovery ()}},
183183 onReconnecting (){if (generation=== streamGeneration)lastTick= 0 },
184184 onReconnected (){if (generation=== streamGeneration)requestRecovery ()}
185185 },form .exchangeId ,{marketType: form .marketType ,instrumentId: selectedInstrumentId .value })
186186 if (! connecting)stream= null
187187}
188- function requestRecovery (){const now = Date .now ();if (now- lastRecovery< 5000 )return ;lastRecovery= now;loadChart (true )}
188+ function requestRecovery (){const now = Date .now ();if (now- lastRecovery< 5000 )return ;lastRecovery= now;void loadChart (true )}
189189function resizeChartAfterActivation (){nextTick (()=> {marketChart .value ? .resize ();requestAnimationFrame (()=> marketChart .value ? .resize ());clearTimeout (layoutTimer);layoutTimer= setTimeout (()=> marketChart .value ? .resize (),180 )})}
190190function stop (){pageActive= false ;clearInterval (timer);timer= null ;clearTimeout (layoutTimer);layoutTimer= null ;stopStream ();queuedChartLoad= false ;queuedChartLoadSilent= true ;request++ ;warmRequest++ ;loading .value = false ;chartRefreshing .value = false }
191191function start (){
0 commit comments