Skip to content

Commit a13a0a2

Browse files
committed
Merge branch 'beta'
2 parents ce66393 + 4bd6ebb commit a13a0a2

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

src/botPage/bot/symbol/__tests__/activeSymbols.js

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/botPage/bot/symbol/activeSymbols.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,4 @@ export default class ActiveSymbols {
5757
getSymbols() {
5858
return parsedSymbols
5959
}
60-
getSymbolNames() {
61-
const symbols = _.clone(parsedSymbols)
62-
for (const key of Object.keys(symbols)) {
63-
symbols[key] = symbols[key].display
64-
}
65-
return symbols
66-
}
6760
}

src/botPage/view/blockly/blocks/trade/markets.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ import { bot } from '../../../../bot'
55
import { BlocklyError } from '../../../../../common/error'
66

77
export default () => {
8-
const symbolNames = bot.symbol.activeSymbols.getSymbolNames()
9-
for (const symbol of Object.keys(symbolNames)) {
10-
const allowedCategories = bot.symbol.getAllowedCategoryNames(symbol)
8+
const symbols = bot.symbol.activeSymbols.getSymbols()
9+
for (const k of Object.keys(symbols)) {
10+
const allowedCategories = bot.symbol.getAllowedCategoryNames(k)
1111
if (allowedCategories.length) {
12-
Blockly.Blocks[symbol] = {
12+
Blockly.Blocks[k] = {
1313
init: function init() {
1414
this.appendDummyInput()
15-
.appendField(symbolNames[symbol])
15+
.appendField(symbols[k].display)
1616
this.appendDummyInput()
1717
.appendField(`${translator.translateText('Accepts')}: (${allowedCategories})`)
1818
this.appendStatementInput('CONDITION')
1919
.setCheck('Condition')
2020
this.setInputsInline(false)
2121
this.setPreviousStatement(true, null)
2222
this.setColour('#f2f2f2')
23-
this.setTooltip(`${translator.translateText('Chooses the symbol:')} ${symbolNames[symbol]}`); // eslint-disable-line max-len
23+
this.setTooltip(`${translator.translateText('Chooses the symbol:')} ${symbols[k].display}`); // eslint-disable-line max-len
2424
this.setHelpUrl('https://github.com/binary-com/binary-bot/wiki')
2525
},
2626
onchange: function onchange(ev) {
2727
submarket(this, ev)
2828
},
2929
}
30-
Blockly.JavaScript[symbol] = function market(block) {
30+
Blockly.JavaScript[k] = function market(block) {
3131
const condition = Blockly.JavaScript.statementToCode(block, 'CONDITION')
3232
if (!condition) {
3333
return new BlocklyError(
@@ -37,7 +37,7 @@ export default () => {
3737
getTradeOptions = function getTradeOptions() {
3838
var tradeOptions = {}
3939
tradeOptions = ${condition.trim()}
40-
tradeOptions.symbol = '${bot.symbol.activeSymbols.getSymbols()[symbol].symbol}'
40+
tradeOptions.symbol = '${symbols[k].symbol}'
4141
return tradeOptions
4242
}
4343
`

src/botPage/view/blockly/relationChecker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ export const condition = (blockObj, ev, calledByParent) => {
8282
disable(blockObj,
8383
translator.translateText('Trade Type blocks have to be added to submarket blocks'))
8484
} else if (!bot.symbol.isConditionAllowedInSymbol(blockObj.parentBlock_.type, blockObj.type)) {
85-
const symbol = bot.symbol.activeSymbols.getSymbolNames()[blockObj.parentBlock_.type]
8685
disable(blockObj,
87-
`${symbol} ${translator.translateText('does not support category:')}`
86+
`${bot.symbol.activeSymbols.getSymbols()[blockObj.parentBlock_.type].display}`
87+
+ ` ${translator.translateText('does not support category:')}`
8888
+ ` ${bot.symbol.getCategoryNameForCondition(blockObj.type)}`
8989
+ `, ${translator.translateText('Allowed categories are')}`
9090
+ ` ${bot.symbol.getAllowedCategoryNames(blockObj.parentBlock_.type)}`)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy