@@ -28,8 +28,8 @@ module.exports = async (log, success, warn, err, cb) => {
2828 await wait ( 1000 ) ;
2929
3030 log ( 'Getting user indicators' ) ;
31-
3231 const userIndicators = await TradingView . getPrivateIndicators ( process . env . SESSION ) ;
32+
3333 if ( userIndicators ) {
3434 if ( userIndicators . length === 0 ) warn ( 'No private indicator found' ) ;
3535 else success ( 'User indicators:' , userIndicators . map ( ( i ) => i . name ) ) ;
@@ -42,6 +42,7 @@ module.exports = async (log, success, warn, err, cb) => {
4242 token : process . env . SESSION ,
4343 signature : process . env . SIGNATURE ,
4444 } ) ;
45+
4546 client . onError ( ( ...error ) => {
4647 err ( 'Client error' , error ) ;
4748 } ) ;
@@ -81,7 +82,6 @@ module.exports = async (log, success, warn, err, cb) => {
8182 await wait ( 1000 ) ;
8283
8384 log ( 'Loading indicators...' ) ;
84-
8585 for ( const indic of userIndicators ) {
8686 const privateIndic = await indic . get ( ) ;
8787 log ( `[${ indic . name } ] Loading indicator...` ) ;
@@ -97,4 +97,5 @@ module.exports = async (log, success, warn, err, cb) => {
9797 await check ( indic . id ) ;
9898 } ) ;
9999 }
100+ log ( 'Indicators loaded !' ) ;
100101} ;
0 commit comments