@@ -2,7 +2,6 @@ import { Map } from 'immutable';
22import { historyToTicks , getLast } from 'binary-utils' ;
33import { observer as globalObserver } from '../../common/utils/observer' ;
44import { doUntilDone , getUUID } from '../bot/tools' ;
5- import { getTokenList , removeAllTokens } from '../../common/utils/storageManager' ;
65
76const parseTick = tick => ( {
87 epoch : + tick . epoch ,
@@ -55,30 +54,15 @@ export default class TicksService {
5554 }
5655
5756 return new Promise ( resolve => {
58- const getActiveSymbols = ( ) => {
59- this . api . getActiveSymbolsBrief ( ) . then ( r => {
60- const { active_symbols : symbols } = r ;
61- this . pipSizes = symbols . reduce ( ( accumulator , currSymbol ) => {
62- // eslint-disable-next-line no-param-reassign
63- accumulator [ currSymbol . symbol ] = `${ currSymbol . pip } ` . length - 2 ;
64- return accumulator ;
65- } , { } ) ;
66- resolve ( this . pipSizes ) ;
67- } ) ;
68- } ;
69-
70- const tokenList = getTokenList ( ) ;
71- if ( tokenList . length ) {
72- this . api
73- . authorize ( tokenList [ 0 ] . token )
74- . then ( ( ) => getActiveSymbols ( ) )
75- . catch ( ( ) => {
76- removeAllTokens ( ) ;
77- getActiveSymbols ( ) ;
78- } ) ;
79- } else {
80- getActiveSymbols ( ) ;
81- }
57+ this . api . getActiveSymbolsBrief ( ) . then ( r => {
58+ const { active_symbols : symbols } = r ;
59+ this . pipSizes = symbols . reduce ( ( accumulator , currSymbol ) => {
60+ // eslint-disable-next-line no-param-reassign
61+ accumulator [ currSymbol . symbol ] = `${ currSymbol . pip } ` . length - 2 ;
62+ return accumulator ;
63+ } , { } ) ;
64+ resolve ( this . pipSizes ) ;
65+ } ) ;
8266 } ) ;
8367 }
8468 request ( options ) {
0 commit comments