Skip to content

Commit

Permalink
fix: renamed function for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Feb 12, 2025
1 parent 3bba7f8 commit 9999561
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/external/bot-skeleton/scratch/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,14 @@ const getMissingBlocks = (workspace, required_block_types) => {
const getDisabledBlocks = required_blocks_check => {
const workspace = window.Blockly.derivWorkspace;
const required_block_types = [getSelectedTradeType(workspace), ...config().mandatoryMainBlocks];
const flag_disabled_blocks = Object.fromEntries(
const disabled_blocks = Object.fromEntries(
workspace
.getAllBlocks()
.filter(block => required_block_types.includes(block.type))
.map(block => [block.type, block.disabled])
);
const mandatory_blocks = ['before_purchase', 'purchase', 'trade_definition', 'trade_definition_tradeoptions'];
const has_disabled_blocks = mandatory_blocks.some(type => flag_disabled_blocks[type]);
const has_disabled_blocks = mandatory_blocks.some(type => disabled_blocks[type]);

return has_disabled_blocks
? required_blocks_check.filter(block => block.disabled || block.childBlocks_?.some(child => child.disabled))
Expand Down

0 comments on commit 9999561

Please sign in to comment.