Skip to content

Commit 155f97f

Browse files
committed
fix react error
1 parent d53931a commit 155f97f

File tree

1 file changed

+5
-4
lines changed
  • src/components/ui/coaching-sessions/coaching-notes

1 file changed

+5
-4
lines changed

src/components/ui/coaching-sessions/coaching-notes/toolbar.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ export const Toolbar = () => {
2222
const { editor } = useCurrentEditor();
2323
const [isLinkDialogOpen, setIsLinkDialogOpen] = useState(false);
2424

25-
if (!editor) {
26-
return null;
27-
}
28-
// Add keyboard shortcut handler
2925
useEffect(() => {
3026
const handleKeyDown = (e: KeyboardEvent) => {
3127
if ((e.metaKey || e.ctrlKey) && e.key === "k" && editor?.isFocused) {
@@ -38,6 +34,11 @@ export const Toolbar = () => {
3834
return () => document.removeEventListener("keydown", handleKeyDown);
3935
}, [editor]);
4036

37+
if (!editor) {
38+
return null;
39+
}
40+
// Add keyboard shortcut handler
41+
4142
return (
4243
<>
4344
<div className="flex items-center gap-0 mt-1 mx-1 mb-0">

0 commit comments

Comments
 (0)