Skip to content

Commit

Permalink
fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyc committed May 29, 2019
1 parent 1bb9a8e commit 5268630
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class GutenbergTemplates {
changeTemplate() {
const { resetBlocks, editPost, updateEditorSettings } = dispatch('core/editor');
const { createWarningNotice, removeNotice } = dispatch('core/notices');
const currentBlocks = select('core/editor').getBlocks();

apiRequest({ path: '/gutenberg-templates/v1/template', data: {template: this.template} }).then(config => {
const currentBlocks = select('core/editor').getBlocks();
const template = config.template;
const templateLock = config.template_lock;
const isValidTemplate = !currentBlocks.length || doBlocksMatchTemplate(currentBlocks, template);
Expand Down

0 comments on commit 5268630

Please sign in to comment.