Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: stop persistent calls to endSearch

thecodrr9dc5b1878167
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index bae0b64fa..db77f8cc2 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -148,8 +148,9 @@ function TipTap(props: TipTapProps) {
);
useEffect(() => {
+ const isEditorSearching = editor?.storage.searchreplace?.isSearching;
if (isSearching) editor?.commands.startSearch();
- else editor?.commands.endSearch();
+ else if (isEditorSearching) editor?.commands.endSearch();
}, [isSearching]);
useEffect(() => {