Skip to content

Commit

Permalink
Edit Post: Use a single 'useSelect' hook for getting selectors (#55902)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Nov 6, 2023
1 parent e848ed2 commit 12313cf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/edit-post/src/components/keyboard-shortcuts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { createBlock } from '@wordpress/blocks';
import { store as editPostStore } from '../../store';

function KeyboardShortcuts() {
const { getBlockSelectionStart } = useSelect( blockEditorStore );
const { getEditorMode, isEditorSidebarOpened, isListViewOpened } =
useSelect( editPostStore );
const isModeToggleDisabled = useSelect( ( select ) => {
Expand All @@ -38,8 +37,12 @@ function KeyboardShortcuts() {
const { registerShortcut } = useDispatch( keyboardShortcutsStore );

const { replaceBlocks } = useDispatch( blockEditorStore );
const { getBlockName, getSelectedBlockClientId, getBlockAttributes } =
useSelect( blockEditorStore );
const {
getBlockName,
getSelectedBlockClientId,
getBlockAttributes,
getBlockSelectionStart,
} = useSelect( blockEditorStore );

const handleTextLevelShortcut = ( event, level ) => {
event.preventDefault();
Expand Down

1 comment on commit 12313cf

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 12313cf.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6773863595
📝 Reported issues:

Please sign in to comment.