Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit e616d7e

Browse files
author
Aaron
authored
Merge pull request #2555 from binary-com/dev
dev to beta
2 parents ff51ef6 + bda8c17 commit e616d7e

File tree

1 file changed

+9
-25
lines changed

1 file changed

+9
-25
lines changed

src/botPage/common/TicksService.js

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Map } from 'immutable';
22
import { historyToTicks, getLast } from 'binary-utils';
33
import { observer as globalObserver } from '../../common/utils/observer';
44
import { doUntilDone, getUUID } from '../bot/tools';
5-
import { getTokenList, removeAllTokens } from '../../common/utils/storageManager';
65

76
const 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

Comments
 (0)