mirror of
https://github.com/WenPai-org/wpmind.git
synced 2025-08-03 11:11:27 +08:00
better selected blocks array
This commit is contained in:
parent
fb53b429b9
commit
458825e8c6
1 changed files with 7 additions and 2 deletions
|
@ -8,8 +8,13 @@ export default function getSelectedBlocksJSON() {
|
|||
ids.forEach((id) => {
|
||||
const blockData = getBlock(id);
|
||||
|
||||
if (blockData?.attributes?.content) {
|
||||
blocksJSON.push(blockData);
|
||||
if (blockData?.name && blockData?.attributes) {
|
||||
blocksJSON.push({
|
||||
clientId: blockData.clientId,
|
||||
name: blockData.name,
|
||||
attributes: blockData.attributes,
|
||||
innerBlocks: blockData?.innerBlocks || [],
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue