Skip to content

Commit c067bd8

Browse files
fix: move state to top
1 parent e472797 commit c067bd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/twenty-front/src/modules/blocknote-editor/components/BlockEditorDropdownFocusEffect.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { useSetActiveDropdownFocusIdAndMemorizePrevious } from '@/ui/layout/drop
99
import { useRecoilComponentCallbackState } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentCallbackState';
1010

1111
export const BlockEditorDropdownFocusEffect = () => {
12+
const [prevShowing, setPrevShowing] = useState<boolean | null>(null);
13+
1214
const isSlashMenuOpenState = useRecoilComponentCallbackState(
1315
isSlashMenuOpenComponentState,
1416
);
@@ -46,8 +48,6 @@ export const BlockEditorDropdownFocusEffect = () => {
4648
],
4749
);
4850

49-
const [prevShowing, setPrevShowing] = useState<boolean | null>(null);
50-
5151
if (prevShowing !== isSlashMenuShowing) {
5252
setPrevShowing(isSlashMenuShowing);
5353
syncSlashMenuState(isSlashMenuShowing);

0 commit comments

Comments
 (0)