Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/external/bot-skeleton/scratch/backward-compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ export default class BlockConversion {
if (field) {
if (field instanceof window.Blockly.FieldVariable) {
const variable_id = el_block_child.getAttribute('id');
const variable_name = el_block_child.innerText.trim();
const getNodeText = n => (n?.textContent ?? n?.innerText ?? '').trim();
const variable_name = getNodeText(el_block_child);
const variable = window.Blockly.Variables.getOrCreateVariablePackage(
this.workspace,
variable_id,
Expand Down
3 changes: 2 additions & 1 deletion src/external/bot-skeleton/scratch/dbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class DBot {
if (is_symbol_list_change || is_trade_type_cat_list_change) {
const { contracts_for } = ApiHelpers?.instance ?? {};
const top_parent_block = this.getTopParent();
const market_block = top_parent_block.getChildByType('trade_definition_market');
if (!top_parent_block) return;
const market_block = top_parent_block?.getChildByType('trade_definition_market');
const market = market_block.getFieldValue('MARKET_LIST');
const submarket = market_block.getFieldValue('SUBMARKET_LIST');
const symbol = market_block.getFieldValue('SYMBOL_LIST');
Expand Down
Loading