Skip to content

Commit

Permalink
Ensure that insertUsage is always present in preferences (#14706)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Apr 1, 2019
1 parent 0d58c70 commit f5f77d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/editor/src/store/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import { SETTINGS_DEFAULTS } from '@wordpress/block-editor';

export const PREFERENCES_DEFAULTS = {
insertUsage: {}, // Should be kept for backward compatibility, see: https://github.com/WordPress/gutenberg/issues/14580.
isPublishSidebarEnabled: true,
};

Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/store/test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ describe( 'state', () => {
it( 'should apply all defaults', () => {
const state = preferences( undefined, {} );
expect( state ).toEqual( {
insertUsage: {},
isPublishSidebarEnabled: true,
} );
} );
Expand Down

0 comments on commit f5f77d5

Please sign in to comment.