Browse Source

Fix load of initial blocks

fix-initial-blocks
Artur Arseniev 8 months ago
parent
commit
e758f26383
  1. 2
      packages/core/src/block_manager/index.ts

2
packages/core/src/block_manager/index.ts

@ -72,11 +72,11 @@ export default class BlockManager extends ItemManagerModule<BlockManagerConfig,
onInit() { onInit() {
const { config, blocks, blocksVisible } = this; const { config, blocks, blocksVisible } = this;
blocks.add(config.blocks || []);
// Setup the sync between the global and public collections // Setup the sync between the global and public collections
blocks.on('add', (model) => blocksVisible.add(model)); blocks.on('add', (model) => blocksVisible.add(model));
blocks.on('remove', (model) => blocksVisible.remove(model)); blocks.on('remove', (model) => blocksVisible.remove(model));
blocks.on('reset', (coll) => blocksVisible.reset(coll.models)); blocks.on('reset', (coll) => blocksVisible.reset(coll.models));
blocks.add(config.blocks || []);
} }
/** /**

Loading…
Cancel
Save