From 41d9cf7279f0acc99449c46c9c76033a976421b5 Mon Sep 17 00:00:00 2001 From: Aaron Imming Date: Fri, 28 Dec 2018 13:34:08 +0800 Subject: [PATCH] Remove default values that would error some clients --- src/botPage/view/blockly/blocks/shared.js | 4 ++-- .../blockly/blocks/trade/backwardCompatibility.js | 3 --- src/botPage/view/blockly/blocks/trade/components.js | 2 +- static/xml/main.xml | 11 +---------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/botPage/view/blockly/blocks/shared.js b/src/botPage/view/blockly/blocks/shared.js index 4cd71db961..7c1d9c9365 100644 --- a/src/botPage/view/blockly/blocks/shared.js +++ b/src/botPage/view/blockly/blocks/shared.js @@ -77,7 +77,7 @@ const getActiveMarket = markets => {} ); -fieldGeneratorMapping.MARKET_LIST = () => () => { +fieldGeneratorMapping.MARKET_LIST = () => { const markets = getActiveMarket(symbolApi.activeSymbols.getMarkets()); return Object.keys(markets).map(e => [markets[e].name, e]); }; @@ -85,7 +85,7 @@ fieldGeneratorMapping.MARKET_LIST = () => () => { fieldGeneratorMapping.SUBMARKET_LIST = block => () => { const markets = getActiveMarket(symbolApi.activeSymbols.getMarkets()); const marketName = block.getFieldValue('MARKET_LIST'); - if (marketName === 'Invalid') { + if (!marketName || marketName === 'Invalid') { return [['', 'Invalid']]; } const submarkets = getActiveSubMarket(markets[marketName].submarkets); diff --git a/src/botPage/view/blockly/blocks/trade/backwardCompatibility.js b/src/botPage/view/blockly/blocks/trade/backwardCompatibility.js index 89df0052de..cf6e2bb250 100644 --- a/src/botPage/view/blockly/blocks/trade/backwardCompatibility.js +++ b/src/botPage/view/blockly/blocks/trade/backwardCompatibility.js @@ -46,9 +46,6 @@ export default () => { init: function init() { duration(this); payout(this); - prediction(this); - barrierOffset(this); - secondBarrierOffset(this); this.setInputsInline(false); this.setPreviousStatement(true, 'Condition'); }, diff --git a/src/botPage/view/blockly/blocks/trade/components.js b/src/botPage/view/blockly/blocks/trade/components.js index a3ecd68ea0..beec595de4 100644 --- a/src/botPage/view/blockly/blocks/trade/components.js +++ b/src/botPage/view/blockly/blocks/trade/components.js @@ -9,7 +9,7 @@ export const marketDropdown = block => { block .appendDummyInput('MARKETDEFINITION') .appendField(`${translate('Market')}:`) - .appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.MARKET_LIST()), 'MARKET_LIST') + .appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.MARKET_LIST), 'MARKET_LIST') .appendField('>') .appendField(new Blockly.FieldDropdown(fieldGeneratorMapping.SUBMARKET_LIST(block)), 'SUBMARKET_LIST') .appendField('>') diff --git a/static/xml/main.xml b/static/xml/main.xml index 7f447f569d..88140c3ad1 100644 --- a/static/xml/main.xml +++ b/static/xml/main.xml @@ -1,14 +1,5 @@  - volidx - random_index - R_100 - callput - risefall - both - 60 - FALSE - TRUE t @@ -29,7 +20,7 @@ - CALL +