Skip to content

Commit

Permalink
Fix insertUsage persistance in block-editor store (#28694)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored Feb 4, 2021
1 parent b17dbfc commit 8035392
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/data/src/plugins/persistence/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,16 @@ persistencePlugin.__unstableMigrate = ( pluginOptions ) => {
const state = persistence.get();

// Migrate 'insertUsage' from 'core/editor' to 'core/block-editor'
const insertUsage = get( state, [
'core/editor',
'preferences',
'insertUsage',
] );
if ( insertUsage ) {
const editorInsertUsage = state[ 'core/editor' ]?.preferences?.insertUsage;
if ( editorInsertUsage ) {
const blockEditorInsertUsage =
state[ 'core/block-editor' ]?.preferences?.insertUsage;
persistence.set( 'core/block-editor', {
preferences: {
insertUsage,
insertUsage: {
...editorInsertUsage,
...blockEditorInsertUsage,
},
},
} );
}
Expand Down

0 comments on commit 8035392

Please sign in to comment.