Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion frontend/src/react/components/OpBlockNoteEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ import {
openProjectWorkPackageInlineSpec,
workPackageSlashMenu,
useHashWpMenu,
useInlineWpEvents,
useDeduplicateInstanceIds
} from 'op-blocknote-extensions';
import { useCallback, useEffect, useMemo } from 'react';
import * as Y from 'yjs';
import { useBlockNoteAttachments } from '../hooks/useBlockNoteAttachments';
import { useBlockNoteLocale } from '../hooks/useBlockNoteLocale';
import { useOpTheme } from '../hooks/useOpTheme';
import { useInlineWpEvents } from 'op-blocknote-extensions';

interface CollaborativeUser {
name: string;
Expand Down Expand Up @@ -125,6 +126,7 @@ export function OpBlockNoteEditor({
const editor = useCreateBlockNote(editorParams, [activeUser]);

useInlineWpEvents(editor);
useDeduplicateInstanceIds(editor);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I wonder if it might be better to import and call useDeduplicateInstanceIds directly inside useInlineWpEvents (within op-blocknote-extensions) instead of adding it separately in OpBlockNoteEditor.

This way we could avoid accumulating multiple hook imports in the host application and keep related logic encapsulated in one place.

Just a thought - it might help keep things cleaner and easier to maintain going forward


const theme = useOpTheme();

Expand Down
Loading