Skip to content

Commit

Permalink
Fixed display of convert menu for blocks without export rule
Browse files Browse the repository at this point in the history
According to the workflow script from the documentation:
https://editorjs.io/tools-api/#conversionconfig
  • Loading branch information
VolgaIgor committed Aug 2, 2024
1 parent 057bf17 commit 5953809
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/utils/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export async function getConvertibleToolsForBlock(block: BlockAPI, allBlockTools
const savedData = await block.save() as SavedData;
const blockData = savedData.data;

/**
* Checking that the block has an «export» rule
*/
const blockTool = allBlockTools.find((tool) => tool.name === block.name);
if (!isToolConvertable(blockTool, 'export')) {
return [];
}

return allBlockTools.reduce((result, tool) => {
/**
* Skip tools without «import» rule specified
Expand Down

0 comments on commit 5953809

Please sign in to comment.