File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,17 @@ export const settings = {
77
77
78
78
// Reload when changes are made to access plans.
79
79
$ ( document ) . one ( 'llms-access-plans-updated' , function ( ) {
80
+
81
+ // Replacing the block with a duplicate of itself so we can reload the block from the server.
80
82
dispatch ( 'core/editor' ) . replaceBlock ( props . clientId , createBlock ( name ) ) ;
83
+
84
+ // This will save the updates to the post content that appear as a result of the replacement.
85
+ // Since I can't seem to figure out how to prevent the change from being triggered we have to duplicate a save.
86
+ // which is gross. I know it's gross. It works though....
87
+ setTimeout ( function ( ) {
88
+ dispatch ( 'core/editor' ) . savePost ( ) ;
89
+ } , 500 ) ;
90
+
81
91
} ) ;
82
92
83
93
return (
You can’t perform that action at this time.
0 commit comments