Skip to content

Commit

Permalink
Zoom Out: Force device type to Desktop whenever zoom out is invoked (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian authored Sep 6, 2024
1 parent db44c13 commit 6bbdd1e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/editor/src/store/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,9 +1276,15 @@ export function getRenderingMode( state ) {
*
* @return {string} Device type.
*/
export function getDeviceType( state ) {
return state.deviceType;
}
export const getDeviceType = createRegistrySelector(
( select ) => ( state ) => {
const editorMode = select( blockEditorStore ).__unstableGetEditorMode();
if ( editorMode === 'zoom-out' ) {
return 'Desktop';
}
return state.deviceType;
}
);

/**
* Returns true if the list view is opened.
Expand Down

0 comments on commit 6bbdd1e

Please sign in to comment.