Skip to content

Commit

Permalink
Editor: No need to reset mode when changing device preview types (Wor…
Browse files Browse the repository at this point in the history
…dPress#66261)


Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: draganescu <andraganescu@git.wordpress.org>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent a416596 commit 3b2b2ed
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions packages/editor/src/components/preview-dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
};
}, [] );
const { setDeviceType } = useDispatch( editorStore );
const { __unstableSetEditorMode } = useDispatch( blockEditorStore );
const { resetZoomLevel } = unlock( useDispatch( blockEditorStore ) );

const handleDevicePreviewChange = ( newDeviceType ) => {
setDeviceType( newDeviceType );
__unstableSetEditorMode( 'edit' );
resetZoomLevel();
};

Expand Down

0 comments on commit 3b2b2ed

Please sign in to comment.