Skip to content

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Jul 2, 2024
1 parent 46f900e commit 352d73a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions assets/js/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,15 @@ class ConvertToBlocksEditorSupport {
return null;
}

setTimeout(() => {
const saveDelay = config?.agent?.save_delay || 0;

if (saveDelay > 0) {
setTimeout(() => {
client.save();
}, saveDelay);
} else {
client.save();
}, config.agent.save_delay);
}

return null;
}, 500);
Expand Down
2 changes: 1 addition & 1 deletion includes/ConvertToBlocks/MigrationAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function register() {
[
'agent' => [
'next' => $this->next(),
'save_delay' => apply_filters( 'convert_to_blocks_save_delay', 500, $post_id )
'save_delay' => apply_filters( 'convert_to_blocks_save_delay', 0, $post_id )
],
]
);
Expand Down

0 comments on commit 352d73a

Please sign in to comment.